From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20344 invoked by alias); 18 Nov 2002 20:46:11 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20275 invoked by uid 71); 18 Nov 2002 20:46:09 -0000 Date: Sun, 24 Nov 2002 03:25:00 -0000 Message-ID: <20021118204608.20274.qmail@sources.redhat.com> To: neil@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Neil Booth Subject: Re: preprocessor/8524: _Pragma within macros is improperly expanded Reply-To: Neil Booth X-SW-Source: 2002-11/txt/msg00898.txt.bz2 List-Id: The following reply was made to PR preprocessor/8524; it has been noted by GNATS. From: Neil Booth To: 157416@bugs.debian.org, Andrew Suffield Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org, Zack Weinberg , gcc-patches@gcc.gnu.org Subject: Re: preprocessor/8524: _Pragma within macros is improperly expanded Date: Mon, 18 Nov 2002 20:43:38 +0000 Neil Booth wrote:- > I think this fixes it for good. I'm applying this to 3.3, and 3.2.2 > when it arrives. > > Neil. > > PR preprocessor/8524 > * cpplib.c (run_directive): Remove previous kludge to _Pragma. > Add a new one in its place, which hopefully works. > (skip_rest_of_line): Change test for bottom-of-context-stack. > testsuite: > * gcc.dg/cpp/_Pragma5.c: New test. Oops, the test got lost waiting for CVS. Neil. Index: testsuite/gcc.dg/cpp/_Pragma5.c =================================================================== RCS file: testsuite/gcc.dg/cpp/_Pragma5.c diff -N testsuite/gcc.dg/cpp/_Pragma5.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/gcc.dg/cpp/_Pragma5.c 18 Nov 2002 20:40:43 -0000 @@ -0,0 +1,14 @@ +/* { dg-do preprocess } */ + +/* Based on Debian GNATS PR 8524. 17 Nov 2002. */ + +#define ALPHA(A) alpha_ ## A +#define BETA(B) beta_ ## B +#define GAMMA(C) _Pragma("moose") ALPHA(C) BETA(C) +GAMMA(baz); + +/* + { dg-final { if ![file exists _Pragma5.i] { return } } } + { dg-final { if { [grep _Pragma5.i "alpha_baz beta_baz;"] != "" } { return } } } + { dg-final { fail "_Pragma5.c: _Pragma in macro" } } +*/