HomePhabricator

[analyzer] Fix function macro crash

Authored by Szelethus on Mar 12 2019, 3:03 AM.

Description

[analyzer] Fix function macro crash

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.

Patch by Tibor Brunner!

Differential Revision: https://reviews.llvm.org/D57893

llvm-svn: 355903

Details

Committed
SzelethusMar 12 2019, 3:03 AM
Differential Revision
D57893: [analyzer] Fix function macro crash
Parents
rG20ea21c6ede8: [AMDGPU] Add support for immediate operand for S_ENDPGM
Branches
Unknown
Tags
Unknown