re PR c++/51414 (Broken diagnostic with invalid use of __underlying_type)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 5 Dec 2011 18:21:18 +0000 (18:21 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 5 Dec 2011 18:21:18 +0000 (18:21 +0000)
/cp
2011-12-05  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51414
* semantics.c (finish_underlying_type): Use %qT, not %qE for the
error message.

/testsuite
2011-12-05  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51414
* g++.dg/ext/underlying_type11.C: New.

From-SVN: r182017

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

index fe4696bf2050ab4a621f9deb890a8c68dba9fdca..ac8e3115539393a00653c7fda0bfc561c88b37ef 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-05  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51414
+       * semantics.c (finish_underlying_type): Use %qT, not %qE for the
+       error message.
+
 2011-12-05  Jason Merrill  <jason@redhat.com>
 
        * init.c (expand_default_init): Unshare args in ctor delegation.
index 3c9853a3529c594a725161d50c2c61c0df2cd512..cca601d3973681c9f043aca3308035e52a4dfd74 100644 (file)
@@ -3401,7 +3401,7 @@ finish_underlying_type (tree type)
 
   if (TREE_CODE (type) != ENUMERAL_TYPE)
     {
-      error ("%qE is not an enumeration type", type);
+      error ("%qT is not an enumeration type", type);
       return error_mark_node;
     }
 
index fac85fe3323ec792478c34d857cf4aa114b953af..1886e248edfca034836d4e7440b469470cd7aa21 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-05  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51414
+       * g++.dg/ext/underlying_type11.C: New.
+
 2011-12-05  Uros Bizjak  <ubizjak@gmail.com>
 
        PR testsuite/51128
diff --git a/gcc/testsuite/g++.dg/ext/underlying_type11.C b/gcc/testsuite/g++.dg/ext/underlying_type11.C
new file mode 100644 (file)
index 0000000..72ee434
--- /dev/null
@@ -0,0 +1,3 @@
+// PR c++/51414
+
+__underlying_type(int[1]) i; // { dg-error "int \\\[1\\\]|invalid" }