Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ Bug Fixes to C++ Support
authentication enabled. (#GH152601)
- Fix the check for narrowing int-to-float conversions, so that they are detected in
cases where converting the float back to an integer is undefined behaviour (#GH157067).
- Stop rejecting C++11-style attributes on the first argument of constructors in older
standards. (#GH156809).

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 2 additions & 3 deletions clang/lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6007,10 +6007,9 @@ 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 &&
isCXX11AttributeSpecifier(/*Disambiguate*/ false,
if (isCXX11AttributeSpecifier(/*Disambiguate*/ false,
/*OuterMightBeMessageSend*/ true) !=
CXX11AttributeKind::NotAttributeSpecifier) {
CXX11AttributeKind::NotAttributeSpecifier) {
return true;
}

Expand Down
6 changes: 6 additions & 0 deletions clang/test/Parser/cxx03-attributes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++03 %s
// expected-no-diagnostics

struct S {
S([[clang::lifetimebound]] int&) {}
};