Skip to content

Possible fundamental flaw in order of pre-processing? #113

Description

@SimonFraser11

Using the following code snippet:

#define TARGS4 T1,T2,T3,T4
#define FOOIMPL(T__CLASS, TARGS) void foo(const T__CLASS<TARGS>& x) { }
#define FOOIMPL_4(T__CLASS)      FOOIMPL(T__CLASS, TARGS4)
FOOIMPL_4(y)

both gcc and Visual C++ give the following output:

void foo(const y<T1,T2,T3,T4>& x) {}

However CppCheck via simplecpp gives the following error:

[file.cpp:3]: (error) failed to expand 'FOOIMPL_4', Wrong number of parameters for macro 'FOOIMPL'

I'm unsure but this might be related to issues #40 , #79 and #109. Could it be that simplecpp is trying to expand pre-processor arguments too early?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions