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

           Summary: #define followed by a comment while clang is started
                    with -C
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


If starting Clang preprocessor with -E -C command line options on the code:

        #if defined A    // some comment
    ...
        #endif

generates the following error message:

definecomment.cpp:1:16: error: token is not a valid binary operator in a
preprocessor subexpression
        #if defined A   // some comment
            ~~~~~~~~~   ^
<scratch space>:2:1: note: expanded from:
/* some comment*/
^
#line 1 "definecomment.cpp"
#line 1 "definecomment.cpp"
#line 1 "<built-in>"
#line 1 "<built-in>"
#line 144 "<built-in>"
#line 1 "<command line>"
#line 1 "<built-in>"
#line 1 "definecomment.cpp"

1 error generated.
This code creates no issues with MSVC compiler. Starting Clang with only -E
switch works fine as well.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to