[LLVMbugs] [Bug 13924] New: Regression(likely r163022): macro expansion is broken in microsoft mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 26 00:48:48 PDT 2012


             Bug #: 13924
           Summary: Regression(likely r163022): macro expansion is broken
                    in microsoft mode
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Nicos-MacBook-Pro:clang thakis$ cat ~/Downloads/testfoo.cc 

#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar

#define GMOCK_ACTION_CLASS_(name, value_params)\
    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)

#define ACTION_TEMPLATE(name, template_params, value_params)\
  class GMOCK_ACTION_CLASS_(name, value_params) {\

                HAS_1_TEMPLATE_PARAMS(int, k),
                AND_2_VALUE_PARAMS(p0, p1));
Nicos-MacBook-Pro:clang thakis$ ../../Release+Asserts/bin/clang -c
~/Downloads/testfoo.cc   -fms-compatibility 
/Users/thakis/Downloads/testfoo.cc:16:42: error: too few arguments provided to
function-like macro invocation
                AND_2_VALUE_PARAMS(p0, p1));
/Users/thakis/Downloads/testfoo.cc:11:35: note: expanded from macro
  class GMOCK_ACTION_CLASS_(name, value_params) {\
/Users/thakis/Downloads/testfoo.cc:8:62: note: expanded from macro
    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
1 error generated.

This is from gtest. This works fine with regular (non-ms-mode) clang, gcc, and

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