[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


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

             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_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
#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) {\
  }

ACTION_TEMPLATE(InvokeArgument,
                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
'ACTION_TEMPLATE'
  class GMOCK_ACTION_CLASS_(name, value_params) {\
                                  ^
/Users/thakis/Downloads/testfoo.cc:8:62: note: expanded from macro
'GMOCK_ACTION_CLASS_'
    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
cl.

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