This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/53229] New: macro unwinder for preprocessing errors


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53229

             Bug #: 53229
           Summary: macro unwinder for preprocessing errors
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: manu@gcc.gnu.org


struct x {
  int i;
};
struct x x;

#define TEST(X) x.##X

void foo (void)
{
  TEST(i) = 0;
}

manuel@gcc12:~$ ~/trunk/187148M/build/gcc/cc1 test.c
 foo
test.c: In function âfooâ:
test.c:10:1: error: pasting "." and "i" does not give a valid preprocessing
token
   TEST(i) = 0;
 ^

manuel@gcc12:~$ clang test.c
test.c:10:3: error: pasting formed '.i', an invalid preprocessing token
  TEST(i) = 0;
  ^
test.c:6:19: note: expanded from macro 'TEST'
#define TEST(X) x.##X
                  ^

GCC should say:

test.c:6:19: error: pasting "." and "i" does not give a valid preprocessing
token (did you mean 'x.X'?)
#define TEST(X) x.##X
                  ^
test.c:10:3: note: in expansion of macro 'TEST' requested here
  TEST(i) = 0;
  ^


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]