re PR c++/17595 (Unfriendly error message/rejects legal #pragmas in the middle of...
authorMark Mitchell <mark@codesourcery.com>
Thu, 23 Dec 2004 22:19:54 +0000 (22:19 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 23 Dec 2004 22:19:54 +0000 (22:19 +0000)
PR c++/17595
* parser.c (cp_parser_error): Issue better messages about
#pragma in locations where it is not permitted.

PR c++/17595
* g++.dg/parse/pragma2.C: New test.

From-SVN: r92573

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/pragma2.C [new file with mode: 0644]

index e3e6ae7033cbcd98dba854ceda91e022df3f0f3c..6e3c26251f051ec5a0f6babb505fbbf7fc0cb3db 100644 (file)
@@ -1,5 +1,8 @@
 2004-12-23  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/17595
+       * g++.dg/parse/pragma2.C: New test.
+
        * g++.dg/opt/temp1.C: Make memcpy actually copy bytes.
 
 2004-12-23  Alexandre Oliva  <aoliva@redhat.com>
diff --git a/gcc/testsuite/g++.dg/parse/pragma2.C b/gcc/testsuite/g++.dg/parse/pragma2.C
new file mode 100644 (file)
index 0000000..9cab9d8
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/17595
+
+// Ideally, the #pragma error would come one line further down, but it
+// does not.
+int f(int x, // { dg-error "not allowed here" }
+#pragma interface 
+      // The parser gets confused and issues an error on the next line.
+      int y); // { dg-bogus "" "" { xfail *-*-* } }