OSDN Git Service

PR c++/35335
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jan 2009 16:51:55 +0000 (16:51 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jan 2009 16:51:55 +0000 (16:51 +0000)
* error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.

* g++.dg/other/error31.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143210 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/error31.C [new file with mode: 0644]

index 6d09faf..aad07d2 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/35335
+       * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
+
 2009-01-09  John F. Carr  <jfc@mit.edu>
 
        PR c++/37877
index 4a63f1d..16c9628 100644 (file)
@@ -1,7 +1,7 @@
 /* Call-backs for C++ error reporting.
    This code is non-reentrant.
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
@@ -1977,6 +1977,7 @@ dump_expr (tree t, int flags)
 
     case BIND_EXPR:
     case STMT_EXPR:
+    case EXPR_STMT:
     case STATEMENT_LIST:
       /* We don't yet have a way of dumping statements in a
         human-readable format.  */
index b597616..f142e96 100644 (file)
@@ -1,5 +1,8 @@
 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/35335
+       * g++.dg/other/error31.C: New testcase.
+
        PR c/35742
        * gcc.dg/pr35742.c: New test.
 
diff --git a/gcc/testsuite/g++.dg/other/error31.C b/gcc/testsuite/g++.dg/other/error31.C
new file mode 100644 (file)
index 0000000..c9e8351
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/35335
+// { dg-do compile }
+// { dg-options "" }
+// { dg-bogus "not supported by" "" { target *-*-* } 0 }
+
+struct A {};           // { dg-message "note: candidates are" }
+
+void
+foo ()
+{
+  A a;
+  a = ({ { 1; } });    // { dg-error "no match for" }
+}