diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-12-19 20:33:28 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-12-19 20:33:28 +0100 |
commit | 6cea69fe29484257a395993304afa4c7c930c4db (patch) | |
tree | 0e5a4f67463b37b8fef4534316b39159b6abc24c /gcc/testsuite/g++.dg | |
parent | 735baa21c2d66b18a6b32fc96a176b57a93cddae (diff) | |
download | gcc-6cea69fe29484257a395993304afa4c7c930c4db.zip gcc-6cea69fe29484257a395993304afa4c7c930c4db.tar.gz gcc-6cea69fe29484257a395993304afa4c7c930c4db.tar.bz2 |
re PR c++/38577 (ICE: tree check: expected call_expr, have compound_expr in build_new_method_call, at cp/call.c:6000)
PR c++/38577
* call.c (build_new_method_call): Handle call being COMPOUND_EXPR
or NOP_EXPR.
* g++.dg/template/call6.C: New test.
From-SVN: r142842
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/template/call6.C | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/call6.C b/gcc/testsuite/g++.dg/template/call6.C new file mode 100644 index 0000000..b79d624 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/call6.C @@ -0,0 +1,24 @@ +// PR c++/38577 +// { dg-do compile } + +struct A +{ + static A *bar (); +}; + +struct B : public A +{ + static void baz (); +}; + +template <class T> +void foo () +{ + (static_cast<B *> (A::bar ()))->baz (); +} + +void +bar () +{ + foo<int> (); +} |