================
@@ -183,7 +185,12 @@ void foo(int size) {
   NonTriviallyDestructible array[2];  // no warning
   NonTriviallyDestructible nestedArray[2][2]; // no warning
 
+  // Copy initialzation gives warning before C++17
+#if __cplusplus <= 201402L
   Foo fooScalar = 1; // expected-warning {{unused variable 'fooScalar'}}
+#else
+  Foo fooScalar = 1; // no warning
----------------
Endilll wrote:

Code around here can be replaced with a single line:
```
Foo fooScalar = 1; // cxx98-14-warning {{unused variable 'fooScalar'}}
```
Look at DR tests again how to make this happen (via `-verify=`):
https://github.com/llvm/llvm-project/blob/3902f9b6e2d925d50f9a4861d78e5aba07b6ef11/clang/test/CXX/drs/dr0xx.cpp#L1-L3

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

Reply via email to