================
@@ -92,6 +92,19 @@ void foo() {
   bool is_true = [](){ return true; };
   // expected-warning@-1{{address of lambda function pointer conversion 
operator will always evaluate to 'true'}}
 }
+
+template <typename... Ts>
+static bool IsFalse(const Ts&...) { return false; }
+template <typename T>
+static bool IsFalse(const T& p) {
+  bool b;
+  b = f7; // expected-warning {{address of lambda function pointer conversion 
operator will always evaluate to 'true'}}
+  return p ? false : true;
----------------
AaronBallman wrote:

```suggestion
  // Intentionally not warned on because p could be a lambda type in one 
instantiation, but a pointer
  // type in another.
  return p ? false : true;
```
(May need to adjust for 80-col limits.)

https://github.com/llvm/llvm-project/pull/83497
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to