aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with some minor corrections in comments, thank you for the fix!
================
Comment at: clang/lib/Sema/SemaStmt.cpp:381-382
- DiagRuntimeBehavior(Loc, nullptr, PDiag(DiagID) << R1 << R2);
+ // Skip diagnose for comma operator in SFINAE context since the type of left
+ // operand could trigger substitution error so technically it is *used*.
+ if (DiagID != diag::warn_unused_comma_left_operand || !isSFINAEContext())
----------------
================
Comment at: clang/test/SemaCXX/warn-unused-value.cpp:154
+
+// comma operator diagnoses should be suppressed in SFINAE context.
+template <typename T, int = (T{},0)> int c(int) { return 0; }
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103938/new/
https://reviews.llvm.org/D103938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits