From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10227 invoked by alias); 23 Mar 2011 08:47:46 -0000 Received: (qmail 10176 invoked by uid 22791); 23 Mar 2011 08:47:45 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 08:47:40 +0000 From: "joerg.richter@pdv-fs.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/48248] New: Wrong error message location when compiling preprocessed code X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joerg.richter@pdv-fs.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 23 Mar 2011 09:27:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg02393.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48248 Summary: Wrong error message location when compiling preprocessed code Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor AssignedTo: unassigned@gcc.gnu.org ReportedBy: joerg.richter@pdv-fs.de $ cat > foobar.h << EOF enum Foo { BAR }; #define BAR(x) #define BARBAR BAR EOF $ cat > main.cc << EOF #include "foobar.h" void func() { (void)BARBAR; aaa; } EOF $ g++ -c main.cc main.cc: In function 'void func()': main.cc:8:3: error: 'aaa' was not declared in this scope $ g++ -E main.cc > main.ii $ g++ -c main.ii foobar.h: In function 'void func()': foobar.h:8:3: error: 'aaa' was not declared in this scope Please notice the wrong filename when compiling the preprocessed source. GCC 4.4 doesn't have this problem.