re PR c++/51415 (Broken diagnostic: 'vec_init_expr' not supported by dump_expr)
authorJason Merrill <jason@redhat.com>
Thu, 16 Feb 2012 19:42:08 +0000 (14:42 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 16 Feb 2012 19:42:08 +0000 (14:42 -0500)
PR c++/51415
* error.c (dump_expr): Handle lambda closures specifically.

From-SVN: r184314

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C [new file with mode: 0644]

index 864b6d34506d7e2b13277c34ec66a1e3493e2699..773f364524973e720251479d47ed74b887fe3685 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51415
+       * error.c (dump_expr): Handle lambda closures specifically.
+
 2012-02-14  Jason Merrill  <jason@redhat.com>
 
        * parser.c (cp_parser_explicit_instantiation): Give a warning
index 09c6caec9a42060854bba0f158eca6ce7359c34e..4ec263b0c3f8d0e35fbb9e7d92eb060110267f55 100644 (file)
@@ -2189,6 +2189,8 @@ dump_expr (tree t, int flags)
                }
            }
        }
+      if (TREE_TYPE (t) && LAMBDA_TYPE_P (TREE_TYPE (t)))
+       pp_string (cxx_pp, "<lambda closure object>");
       if (TREE_TYPE (t) && EMPTY_CONSTRUCTOR_P (t))
        {
          dump_type (TREE_TYPE (t), 0);
index 76f2bb619fe1ac70d42f70a621eca249cdc4da91..4ae411963b7fa582fe08467b13c7d206fe200e41 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/51415
+       * g++.dg/cpp0x/lambda/lambda-err1.C: New.
+
 2012-02-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/52255
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-err1.C
new file mode 100644 (file)
index 0000000..ebf0cbd
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/51415
+// { dg-do compile { target c++11 } }
+
+void foo()
+{
+  int x[1];
+  [x]{} = 0;                   // { dg-error "lambda closure" }
+}