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

             Bug #: 12464
           Summary: Macro expansion bug when a function-like macro is
                    redefined in its own arguments.
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


clang does not handle this case from the GNU CPP manual: 
http://gcc.gnu.org/onlinedocs/cpp/Directives-Within-Macro-Arguments.html#Directives-Within-Macro-Arguments

#define f(x) x x
f (1
#undef f
#define f 2
f)

This expand to the following using gcc -E:

1 2 1 2

But instead clang sees this as an error and doesn't expand the macro:

function_arguments_directives.c:2:1: error: too many arguments provided to
      function-like macro invocation
f (1
^

f

-- 
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