[clang] [Clang][Sema] Fix crash in CheckUsingDeclQualifier due to diagnostic missing an argument (PR #161277)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 10 15:51:47 PDT 2025


================
@@ -430,3 +434,15 @@ void ctad_test() {
   CTAD t = s; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17}}
 }
 #endif
+
+namespace GH161702 {
+struct S {
+  enum E { A };
+  using E::A; // expected-warning {{enumeration type in nested name specifier is incompatible with C++98}}
+#ifndef CXX20COMPAT 
----------------
zygoloid wrote:

I think this was just an oversight -- that change also added a distinct compatibility warning for `explicit(bool)`, and was probably trying to avoid issuing two warnings for the same thing by disabling the existing warning in C++20 mode, but went too far. Disabling the `explicit` conversion function warning in the case of `explicit(bool)` is probably the right thing to do instead of disabling it in C++20.

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


More information about the cfe-commits mailing list