]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport:
authorVolker Reichelt <reichelt@netcologne.de>
Wed, 2 Jan 2008 23:49:23 +0000 (23:49 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Wed, 2 Jan 2008 23:49:23 +0000 (23:49 +0000)
2007-11-02  Paolo Carlini  <pcarlini@suse.de>

PR c++/33495
* error.c (dump_expr): Deal specially with statements.

* g++.dg/other/error19.C: New.

From-SVN: r131268

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

index 9d3332764227866a413360873252a624eff24ff5..90982f42dc513105e1dca89737e6cfbef00c9fb5 100644 (file)
@@ -1,6 +1,11 @@
 2008-01-02  Volker Reichelt  <reichelt@netcologne.de>
 
        Backport:
+       2007-11-02  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/33495
+       * error.c (dump_expr): Deal specially with statements.
+
        2007-09-27  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/33493
index 8b8fabb8719424ea62320852bc73aadc1fad54dc..e495e430aed29ac19f62f08c631f40215ef12690 100644 (file)
@@ -1324,6 +1324,12 @@ dump_expr (tree t, int flags)
   if (t == 0)
     return;
 
+  if (STATEMENT_CLASS_P (t))
+    {
+      pp_cxx_identifier (cxx_pp, "<statement>");
+      return;
+    }
+
   switch (TREE_CODE (t))
     {
     case VAR_DECL:
index 41c7159bedff1c9f3f17f1039da85ece4ab8bf33..8354a6ea3cacf5a84ea29d211973d1a51bafe3f5 100644 (file)
@@ -1,6 +1,11 @@
 2008-01-02  Volker Reichelt  <reichelt@netcologne.de>
 
        Backport:
+       2007-11-02  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/33495
+       * g++.dg/other/error19.C: New.
+
        2007-09-27  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/33493
diff --git a/gcc/testsuite/g++.dg/other/error19.C b/gcc/testsuite/g++.dg/other/error19.C
new file mode 100644 (file)
index 0000000..9389dc1
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/33495
+
+void foo()
+{
+  if (({while(true);})) // { dg-error "forbids|<statement>" }
+    ;
+}