[LLVMbugs] [Bug 10606] New: C++ operator cannot be used as a macro name

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 8 05:01:23 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10606

           Summary: C++ operator cannot be used as a macro name
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: eremeev at viva64.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Clang is unable to preprocess a file in the Boost library containing macro with
the name 'and'.

Example:
#include <stdio.h>
#define and "test"

#if defined (and)

#endif

int main()
{
  printf(and);
  return 0;
}

clang output:
clang.exe and-test.cpp -E -o and-test.i
and-test.cpp:2:9: error: C++ operator 'and' cannot be used as a macro name
#define and "test"
        ^
and-test.cpp:4:14: error: operator 'defined' requires an identifier
#if defined (and)
             ^
2 errors generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list