diff options
author | Volker Reichelt <reichelt@gcc.gnu.org> | 2010-02-15 04:01:10 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-02-14 23:01:10 -0500 |
commit | 9b48e39ccc3bfcc875f9d47b865e20cd37f54ace (patch) | |
tree | 5204bd5e78384ce189165239bc8584c0fe918d32 | |
parent | 60e25d417383ee3ec11285169884b95a10c7408d (diff) | |
download | gcc-9b48e39ccc3bfcc875f9d47b865e20cd37f54ace.zip gcc-9b48e39ccc3bfcc875f9d47b865e20cd37f54ace.tar.gz gcc-9b48e39ccc3bfcc875f9d47b865e20cd37f54ace.tar.bz2 |
re PR c++/43024 (ICE on template code with -O2 or -O3, regression from 4.4.2)
PR c++/43024
* g++.dg/opt/ice1.C: New.
From-SVN: r156766
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/ice1.C | 41 |
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 891e33d..4ad1e67 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-14 Volker Reichelt <reichelt@gcc.gnu.org> + + PR c++/43024 + * g++.dg/opt/ice1.C: New. + 2010-02-14 Jason Merrill <jason@redhat.com> PR c++/41997 diff --git a/gcc/testsuite/g++.dg/opt/ice1.C b/gcc/testsuite/g++.dg/opt/ice1.C new file mode 100644 index 0000000..7018971 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/ice1.C @@ -0,0 +1,41 @@ +// PR c++/43024 +// { dg-options "-O2" } + +void foo(); + +template<int> struct X +{ + enum { e }; + typedef int Y; +}; + +template<int N = 0> struct A +{ + ~A() { foo(); } + A() { a<0>(0); } + template<int> void a(typename X<!X<N>::e>::Y); + struct B b(); +}; + +struct B +{ + A<> b0, b1, b2, b3; + B operator+ (const B&); +}; + +struct C +{ + A<> c0, c1, c2, c3, c4, c5, c6, c7, c8; +}; + +inline void bar(int i) +{ + A<> a0, a1; + if (i) a0.b() + a0.b() + a0.b() + a0.b(); +} + +void baz() +{ + C c; + bar(0); +} |