This revision was not accepted when it landed; it landed in state "Needs
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG054704082b46: [SemaCXX] Fix false positive of
-Wuninitialized-const-reference in empty… (authored by zequanwu).
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM despite my enduring sadness that Boost elected to use this totally bizarre
approach to silencing unused variable diagnostics when far better-supported
options have existed
This revision was automatically updated to reflect the committed changes.
Closed by commit rG054704082b46: [SemaCXX] Fix false positive of
-Wuninitialized-const-reference in empty… (authored by zequanwu).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
zequanwu marked an inline comment as done.
zequanwu added inline comments.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:435
if ((*I)->getType().isConstQualified())
-classify((*I), ConstRefUse);
+if (!hasTrivialBody(CE))
+ classify((*I),
nick added inline comments.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:435
if ((*I)->getType().isConstQualified())
-classify((*I), ConstRefUse);
+if (!hasTrivialBody(CE))
+ classify((*I), ConstRefUse);
zequanwu wrote:
zequanwu marked 2 inline comments as done.
zequanwu added inline comments.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:435
if ((*I)->getType().isConstQualified())
-classify((*I), ConstRefUse);
+if (!hasTrivialBody(CE))
+ classify((*I),
zequanwu updated this revision to Diff 273184.
zequanwu marked an inline comment as done.
zequanwu added a comment.
Add test cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82425/new/
https://reviews.llvm.org/D82425
Files:
aaron.ballman added a comment.
Personally, I think this behavior is a bit mysterious given that there are
*much* better ways to silence unused variable warnings (like casting to `void`)
that have been well-supported by compilers for a long time and I'd prefer not
to penalize every call
zequanwu marked 2 inline comments as done.
zequanwu added inline comments.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:410
+ if (FunctionDecl *fd = CE->getDirectCallee()) {
+if (FunctionTemplateDecl *ftd = fd->getPrimaryTemplate())
+ return
zequanwu updated this revision to Diff 273103.
zequanwu marked an inline comment as done.
zequanwu added a comment.
Address comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82425/new/
https://reviews.llvm.org/D82425
Files:
nick added a comment.
Thanks @zequanwu, much appreciated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82425/new/
https://reviews.llvm.org/D82425
___
cfe-commits mailing list
hans added a comment.
Okay, since checking this is cheap I suppose we can do it.
Comment at: clang/lib/Analysis/UninitializedValues.cpp:410
+ if (FunctionDecl *fd = CE->getDirectCallee()) {
+if (FunctionTemplateDecl *ftd = fd->getPrimaryTemplate())
+ return
zequanwu created this revision.
zequanwu added reviewers: hans, nick.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Some libraries use empty function to ignore unused variable warnings, which
gets a new warning from `-Wuninitialized-const-reference`, discussed here
13 matches
Mail list logo