https://llvm.org/bugs/show_bug.cgi?id=28918
Bug ID: 28918 Summary: -Wunreachable-code warning involving templated local variable can't be suppressed with extra parentheses Product: clang Version: unspecified Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: cpeter...@mozilla.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16922 --> https://llvm.org/bugs/attachment.cgi?id=16922&action=edit test.cpp -Wunreachable-code warning involving templated local variable can't be suppressed with extra parentheses. I suppressed a -Wunreachable-code warning in Firefox earlier this year [1] by adding extra parentheses, as suggested by Xcode's clang on OS X. Unfortunately, this Firefox warning is back [2] because clang 3.9 on Linux no longer recognizes the parentheses suppression. Attached is a standalone test case that reproduces the insuppressible warning even with Xcode's clang (Apple LLVM version 7.3.0 (clang-703.0.31)). So there is a latent clang bug plus a regression that caused Firefox's previously-suppressible warning to no longer be suppressible. The warning looks like it might only happen when the boolean condition involves an expression with a templated type. In the test case below, a templated local variable gets copy-constructed to form an argument to a boolean helper-function. $ clang++ -Wunreachable-code test.cpp test.cpp:23:5: warning: code will never be executed [-Wunreachable-code] printf("Does clang warn about this code being unreachable?\n"); ^~~~~~ 1 warning generated. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1223265 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1291397 -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs