[clang] [Clang][Sema] Apply CWG400 'Using-declarations and the "struct hack"' to C++98 mode (PR #143492)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 14:30:01 PDT 2025


================
@@ -13632,82 +13632,36 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc, bool HasTypename,
       RequireCompleteDeclContext(const_cast<CXXScopeSpec&>(SS), NamedContext))
     return true;
 
-  if (getLangOpts().CPlusPlus11) {
-    // C++11 [namespace.udecl]p3:
-    //   In a using-declaration used as a member-declaration, the
-    //   nested-name-specifier shall name a base class of the class
-    //   being defined.
+  // CWG400 [namespace.udecl]p3:
----------------
shafik wrote:

We should make sure this also matches current wording. I would prefer the commenting to look more like what is in SemaDecl.cpp where we quote the wording and then refer to the core issue at the bottom.

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


More information about the cfe-commits mailing list