aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-12-19 20:33:28 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-12-19 20:33:28 +0100
commit6cea69fe29484257a395993304afa4c7c930c4db (patch)
tree0e5a4f67463b37b8fef4534316b39159b6abc24c /gcc/testsuite/g++.dg
parent735baa21c2d66b18a6b32fc96a176b57a93cddae (diff)
downloadgcc-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.C24
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> ();
+}