From 5902897a20f64980c4b91886a3c31e412a67cf65 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 23 Dec 2004 22:19:54 +0000 Subject: [PATCH] re PR c++/17595 (Unfriendly error message/rejects legal #pragmas in the middle of a parameter list) 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 | 3 +++ gcc/testsuite/g++.dg/parse/pragma2.C | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 gcc/testsuite/g++.dg/parse/pragma2.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e3e6ae7033c..6e3c26251f0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2004-12-23 Mark Mitchell + 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 diff --git a/gcc/testsuite/g++.dg/parse/pragma2.C b/gcc/testsuite/g++.dg/parse/pragma2.C new file mode 100644 index 00000000000..9cab9d88b87 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/pragma2.C @@ -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 *-*-* } }