[clang] [clang] Allow attributes in constructor argument list in pre-C++11 (PR #157300)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 6 11:47:33 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (camc)

<details>
<summary>Changes</summary>

Resolves GH-156809

---
Full diff: https://github.com/llvm/llvm-project/pull/157300.diff


1 Files Affected:

- (modified) clang/lib/Parse/ParseDecl.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 10355bb874762..62ea148701dee 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -6007,7 +6007,7 @@ bool Parser::isConstructorDeclarator(bool IsUnqualified, bool DeductionGuide,
 
   // A C++11 attribute here signals that we have a constructor, and is an
   // attribute on the first constructor parameter.
-  if (getLangOpts().CPlusPlus11 &&
+  if (getLangOpts().CPlusPlus &&
       isCXX11AttributeSpecifier(/*Disambiguate*/ false,
                                 /*OuterMightBeMessageSend*/ true) !=
           CXX11AttributeKind::NotAttributeSpecifier) {

``````````

</details>


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


More information about the cfe-commits mailing list