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: unassig...@gcc.gnu.org ReportedBy: joerg.rich...@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.