diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2023-03-21 12:48:13 -0400 |
---|---|---|
committer | Tobias Hieta <tobias@hieta.se> | 2023-03-24 08:44:42 +0100 |
commit | 14ed120b230719b2d626666cca8d293d902268b9 (patch) | |
tree | be1ec231612b556ade55d20cbd8f622ab6b2585d | |
parent | 32b8cc7031f01252fa817f3ec30c709d6eedbf73 (diff) | |
download | llvm-14ed120b230719b2d626666cca8d293d902268b9.tar.gz |
No longer issue static lambda pedantic warning for pre-c++2b compat
We were accidentally issuing "static lambdas are incompatible with C++
standards before C++2b" with -pedantic because it was an ExtWarn
diagnostic rather than a Warning. This corrects the diagnostic category
and adds some test coverage.
Fixes #61582
(cherry picked from commit b904e68f13ba7d4f4aa86a3495e2441c99247671)
-rw-r--r-- | clang/docs/ReleaseNotes.rst | 4 | ||||
-rw-r--r-- | clang/include/clang/Basic/DiagnosticParseKinds.td | 2 | ||||
-rw-r--r-- | clang/test/Parser/cxx2b-lambdas-ext-warns.cpp | 1 |
3 files changed, 4 insertions, 3 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 6fcb85ddeef0..b5ce92d5b8ce 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -779,8 +779,8 @@ Bug Fixes to Attribute Support Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ - No longer issue a pre-C++2b compatibility warning in ``-pedantic`` mode - regading overloaded `operator[]` with more than one parmeter. (`#61582 - <https://github.com/llvm/llvm-project/issues/61582>`_) + regading overloaded `operator[]` with more than one parmeter or for static + lambdas. (`#61582 <https://github.com/llvm/llvm-project/issues/61582>`_) - Address the thread identification problems in coroutines. (`#47177 <https://github.com/llvm/llvm-project/issues/47177>`_, diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 36d4bc2a700d..e99beb3a7636 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -1052,7 +1052,7 @@ def err_lambda_template_parameter_list_empty : Error< // C++2b static lambdas def err_static_lambda: ExtWarn< "static lambdas are a C++2b extension">, InGroup<CXX2b>; -def warn_cxx20_compat_static_lambda: ExtWarn< +def warn_cxx20_compat_static_lambda : Warning< "static lambdas are incompatible with C++ standards before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore; def err_static_mutable_lambda : Error< diff --git a/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp b/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp index bcb5574a2fe1..3a80f59aba56 100644 --- a/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp +++ b/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -std=c++20 %s -verify=cxx20 // RUN: %clang_cc1 -std=c++2b %s -verify=cxx2b // RUN: %clang_cc1 -std=c++2b -Wpre-c++2b-compat %s -verify=precxx2b +// RUN: %clang_cc1 -std=c++2b -pedantic %s -verify=cxx2b //cxx2b-no-diagnostics |