erichkeane added inline comments.

================
Comment at: lib/AST/Expr.cpp:2302
+              cast<VarDecl>(DRE->getDecl())->hasLocalStorage()) &&
+            !isa<CallExpr>(CE->getSubExpr()->IgnoreParens())) {
           return CE->getSubExpr()->isUnusedResultAWarning(WarnE, Loc,
----------------
aaron.ballman wrote:
> Does this properly handle calls through function pointers (which usually have 
> implicit casts)?
> ```
> [[nodiscard]] volatile char &(*fp)();
> void g() {
>   (void)fp(); // No diagnostic here, either?
> }
> ```
I added this test, and it seems to work correctly.  Patch with additional test 
incoming.


https://reviews.llvm.org/D39075



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to