[PATCH] D152632: [Clang] Add warnings for CWG2521

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 11 07:03:31 PDT 2023


Endill added inline comments.


================
Comment at: clang/test/CXX/drs/dr25xx.cpp:2
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -Wdeprecated-literal-operator
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -Wdeprecated
 
----------------
We avoid passing compiler options here, because it affects all the tests in the file. If you need to enable or disable a specific diagnostic, better wrap your test with
```
#pragma clang diagnostic push
#pragma clang diagnostic warning "-Wdeprecated-literal-operation" // or "ignored" instead of "warning"
// ...
#pragma clang diagnostic pop
```

That said, files containing newer DRs are not too well maintained at the moment (but I'll get to them at some point). This file in particular lacks RUN lines for all missing language modes, and `-pedantic-errors`. I guess the latter enables diagnostics that are needed for your test. You can use `dr5xx.cpp` as an example.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152632/new/

https://reviews.llvm.org/D152632



More information about the cfe-commits mailing list