diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-03-29 17:02:38 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-03-29 17:02:38 +0200 |
commit | 3cb04a531740217d12221a05fd3c8bacda656dae (patch) | |
tree | 762a40f49a077b141368360bc094e06f267d4400 /gcc | |
parent | b84b294aaf4947356da9d3586f41e625e20ad712 (diff) | |
download | gcc-3cb04a531740217d12221a05fd3c8bacda656dae.tar.gz |
re PR c++/52759 (ICE in cp/mangle.c)
PR c++/52759
* decl.c (start_decl): Don't call maybe_apply_pragma_weak
if processing_template_decl.
* g++.dg/ext/weak4.C: New test.
From-SVN: r185966
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/weak4.C | 9 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 166f559af10..4f9bae85c52 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-03-29 Jakub Jelinek <jakub@redhat.com> + + PR c++/52759 + * decl.c (start_decl): Don't call maybe_apply_pragma_weak + if processing_template_decl. + 2012-03-29 Jason Merrill <jason@redhat.com> PR c++/52743 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f021edf36e5..8c5fda65f64 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4431,7 +4431,8 @@ start_decl (const cp_declarator *declarator, } /* If #pragma weak was used, mark the decl weak now. */ - maybe_apply_pragma_weak (decl); + if (!processing_template_decl) + maybe_apply_pragma_weak (decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1975c9863b..00ec7bb855f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2012-03-29 Jakub Jelinek <jakub@redhat.com> + PR c++/52759 + * g++.dg/ext/weak4.C: New test. + PR tree-optimization/52760 * gcc.c-torture/execute/pr52760.c: New test. diff --git a/gcc/testsuite/g++.dg/ext/weak4.C b/gcc/testsuite/g++.dg/ext/weak4.C new file mode 100644 index 00000000000..5b3cce05cd9 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/weak4.C @@ -0,0 +1,9 @@ +// PR c++/52759 +// { dg-do compile } +// { dg-require-weak "" } +// { dg-options "" } +#pragma weak foo +template <typename T> +struct A { }; +template <typename T> +void bar (A<T> &); |