[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:46:43 PDT 2025


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

Resolves GH-156809

>From f4380abad3d19c7234cf632afca5413ec1a9c97e Mon Sep 17 00:00:00 2001
From: camc <69519329+camc at users.noreply.github.com>
Date: Sat, 6 Sep 2025 18:44:57 +0000
Subject: [PATCH] [clang] Allow attributes in constructor argument list in
 pre-C++11

---
 clang/lib/Parse/ParseDecl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {



More information about the cfe-commits mailing list