Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Fix functor-like macro expansion #601

Closed bruntib closed 5 years ago

bruntib commented 5 years ago

When there is a functor-like macro which is passed as parameter to another "function" macro then its parameters are not listed at the place of expansion:

#define foo(x) int bar() { return x; }
#define hello(fvar) fvar(0)
hello(foo)

int main() { 1 / bar(); }

Expansion of hello(foo) asserted Clang, because it expected an l_paren token in the 3rd line after "foo", since it is a function-like token.

dkrupp commented 5 years ago

Can one of the admins verify this patch?

martong commented 5 years ago

Jenkins: run tests