[PATCH] D52742: [analyzer][WIP] Add macro expansions to the plist output

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 06:42:06 PDT 2018


donat.nagy added a comment.

Does this checker handle the expansion of variadic macros introduced in C++11 (see syntax (3) and (4) here <https://en.cppreference.com/w/cpp/preprocessor/replace>) and the `#` and `##` preprocessor operators?



================
Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:755
+        if (It->is(tok::l_paren)) {
+          while ((++It)->isNot(tok::r_paren)) {
+            assert(It->isNot(tok::eof) &&
----------------
I fear that this does not handle nested parentheses correctly; e.g. in a case like `MACRO_ONE(foo, MACRO_TWO(bar, baz), spam)`, it does not skip `, spam)`.


https://reviews.llvm.org/D52742





More information about the cfe-commits mailing list