[PATCH] D61046: Fix compilation warnings when compiling with GCC 7.3
Shafik Yaghmour via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 09:58:27 PDT 2019
shafik added inline comments.
================
Comment at: clang/trunk/unittests/AST/ASTImporterTest.cpp:4054
+ }
}
----------------
aganea wrote:
> Fixes
> ```
> [2097/2979] Building CXX object tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/LookupTest.cpp.o
> /mnt/f/svn/clang/unittests/Tooling/LookupTest.cpp: In lambda function:
> /mnt/f/svn/clang/unittests/Tooling/LookupTest.cpp:220:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
> if (Type.getDecl()->getQualifiedNameAsString() == "x::y::Old")
> ^
> ```
You mixed up the error messages but I see what is going on.
So you may want to add a comment since it is not apparent that what is going on is due the `EXPECT_TRUE` macro eventually expanding to an `if..else` which is what is triggering the warning. Since someone may come by in the future and just remove the braces since it is not apparent why they are there.
Same below as well.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61046/new/
https://reviews.llvm.org/D61046
More information about the llvm-commits
mailing list