[clang] Turn `-Wdeprecated-literal-operator` on by default (PR #111027)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 11:21:06 PDT 2024


================
@@ -203,6 +203,9 @@ namespace cwg1762 { // cwg1762: 14
   float operator ""E(const char *);
   // since-cxx11-error at -1 {{invalid suffix on literal; C++11 requires a space between literal and identifier}}
   // since-cxx11-warning at -2 {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}}
+  // since-cxx11-warning at -3 {{identifier 'E' preceded by whitespace in a literal operator declaration is deprecated}}
----------------
erichkeane wrote:

After discussion (and to save this thought): What about making the "user-defined literal suffixes not starting with '_' are reserved" be a default error, then making this 'new' diagnostic only happen if the thing starts with an underscore.

I think that fixes THIS case as well as makes the non-fixit-change case actually sane?

https://github.com/llvm/llvm-project/pull/111027


More information about the cfe-commits mailing list