re PR c++/33212 (Broken diagnostic: 'trait_expr' not supported by dump_expr)
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 31 Aug 2007 09:11:43 +0000 (09:11 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 31 Aug 2007 09:11:43 +0000 (09:11 +0000)
/cp
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

PR c++/33212
* parser.c (cp_parser_trait_expr): Check rerurn value of
cp_parser_type_id.

/testsuite
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

PR c++/33212
* g++.dg/ext/is_class_error.C: New.

From-SVN: r127962

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/is_class_error.C [new file with mode: 0644]

index 8f64db42fec833efc86023ce7630a6814338c8dc..9c7adc9ea9669604fa5cc9acdba158946b0bd613 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-31  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/33212
+       * parser.c (cp_parser_trait_expr): Check rerurn value of
+       cp_parser_type_id.
+
 2007-08-30  Ollie Wild  <aaw@google.com>
 
        * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
index 70006c9174a8e97fe8b0ce400494ed046257f0a5..92f443064c18fce507a5b8437df1b1413728cd01 100644 (file)
@@ -6502,6 +6502,9 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
 
   type1 = cp_parser_type_id (parser);
 
+  if (type1 == error_mark_node)
+    return error_mark_node;
+
   /* Build a trivial decl-specifier-seq.  */
   clear_decl_specs (&decl_specs);
   decl_specs.type = type1;
@@ -6516,6 +6519,9 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
  
       type2 = cp_parser_type_id (parser);
 
+      if (type2 == error_mark_node)
+       return error_mark_node;
+
       /* Build a trivial decl-specifier-seq.  */
       clear_decl_specs (&decl_specs);
       decl_specs.type = type2;
@@ -6527,8 +6533,8 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
 
   cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
 
-  /* Complete the trait expr, which may mean either processing the
-     static assert now or saving it for template instantiation.  */
+  /* Complete the trait expression, which may mean either processing
+     the trait expr now or saving it for template instantiation.  */
   return finish_trait_expr (kind, type1, type2);
 }
 
index b5624830ed74fda7a0a38cb348b06ff46f33d46e..f2d371404d6e9a545b22a231440c594163449004 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-31  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/33212
+       * g++.dg/ext/is_class_error.C: New.
+
 2007-08-31  Olivier Hainque  <hainque@adacore.com>
 
        * gnat.dg/test_oalign.adb, oalign[12].ads: New test.
 2007-08-31  David Edelsohn  <edelsohn@gnu.org>
             Revital Eres  <eres@il.ibm.com>
 
-        * gcc.target/powerpc/paired-1.c: New test.
-        * gcc.target/powerpc/paired-2.c: New test.
-        * gcc.target/powerpc/paired-3.c: New test.
-        * gcc.target/powerpc/paired-4.c: New test.
-        * gcc.target/powerpc/paired-5.c: New test.
-        * gcc.target/powerpc/paired-6.c: New test.
-        * gcc.target/powerpc/paired-7.c: New test.
-        * gcc.target/powerpc/ppc-paired.c: New test.
-
-2007-08-30  Ollie Wild  <aaw@google.com>
-
-       g++.dg/conversion/ptrmem2.C: New test.
-       g++.dg/conversion/ptrmem3.C: New test.
-       g++.dg/conversion/ptrmem4.C: New test.
-       g++.dg/conversion/ptrmem5.C: New test.
-       g++.dg/conversion/ptrmem6.C: New test.
-       g++.dg/conversion/ptrmem7.C: New test.
-       g++.dg/conversion/ptrmem8.C: New test.
+       * gcc.target/powerpc/paired-1.c: New test.
+       * gcc.target/powerpc/paired-2.c: New test.
+       * gcc.target/powerpc/paired-3.c: New test.
+       * gcc.target/powerpc/paired-4.c: New test.
+       * gcc.target/powerpc/paired-5.c: New test.
+       * gcc.target/powerpc/paired-6.c: New test.
+       * gcc.target/powerpc/paired-7.c: New test.
+       * gcc.target/powerpc/ppc-paired.c: New test.
+
+2007-08-31  Ollie Wild  <aaw@google.com>
+
+       g++.dg/conversion/ptrmem2.C: New test.
+       g++.dg/conversion/ptrmem3.C: New test.
+       g++.dg/conversion/ptrmem4.C: New test.
+       g++.dg/conversion/ptrmem5.C: New test.
+       g++.dg/conversion/ptrmem6.C: New test.
+       g++.dg/conversion/ptrmem7.C: New test.
+       g++.dg/conversion/ptrmem8.C: New test.
 
 2007-08-31  Paul Thomas  <pault@gcc.gnu.org>
 
diff --git a/gcc/testsuite/g++.dg/ext/is_class_error.C b/gcc/testsuite/g++.dg/ext/is_class_error.C
new file mode 100644 (file)
index 0000000..d037ec7
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/33212
+
+template<int> void foo()
+{
+  __is_class((int); // { dg-error "type-specifier|primary-expression" }
+}