Skip to content

Commit 24b5086

Browse files
committed
rebase after #88074 was merged
Created using spr 1.3.6-beta.1
2 parents 4059c1f + 41b0f2f commit 24b5086

File tree

532 files changed

+20147
-33527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+20147
-33527
lines changed

.github/workflows/release-lit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
cd llvm/utils/lit
5959
# Remove 'dev' suffix from lit version.
6060
sed -i 's/ + "dev"//g' lit/__init__.py
61-
python3 setup.py sdist
61+
python3 setup.py sdist bdist_wheel
6262
6363
- name: Upload lit to test.pypi.org
6464
uses: pypa/gh-action-pypi-publish@release/v1

clang/docs/ReleaseNotes.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ C++20 Feature Support
110110
templates (`P1814R0 <https://wg21.link/p1814r0>`_).
111111
(#GH54051).
112112

113+
- We have sufficient confidence and experience with the concepts implementation
114+
to update the ``__cpp_concepts`` macro to `202002L`. This enables
115+
``<expected>`` from libstdc++ to work correctly with Clang.
116+
113117
C++23 Feature Support
114118
^^^^^^^^^^^^^^^^^^^^^
115119

@@ -348,11 +352,20 @@ Improvements to Clang's diagnostics
348352
(with initializer) entirely consist the condition expression of a if/while/for construct
349353
but are not actually used in the body of the if/while/for construct. Fixes #GH41447
350354

355+
- Clang emits a diagnostic when a tentative array definition is assumed to have
356+
a single element, but that diagnostic was never given a diagnostic group.
357+
Added the ``-Wtentative-definition-array`` warning group to cover this.
358+
Fixes #GH87766
359+
351360
Improvements to Clang's time-trace
352361
----------------------------------
353362

354363
Bug Fixes in This Version
355364
-------------------------
365+
- Clang's ``-Wundefined-func-template`` no longer warns on pure virtual
366+
functions.
367+
(`#74016 <https://github.com/llvm/llvm-project/issues/74016>`_)
368+
356369
- Fixed missing warnings when comparing mismatched enumeration constants
357370
in C (`#29217 <https://github.com/llvm/llvm-project/issues/29217>`).
358371

@@ -507,10 +520,15 @@ Bug Fixes to C++ Support
507520
- Fix an issue caused by not handling invalid cases when substituting into the parameter mapping of a constraint. Fixes (#GH86757).
508521
- Fixed a bug that prevented member function templates of class templates declared with a deduced return type
509522
from being explicitly specialized for a given implicit instantiation of the class template.
523+
- Fixed a crash when ``this`` is used in a dependent class scope function template specialization
524+
that instantiates to a static member function.
510525

511526
- Fix crash when inheriting from a cv-qualified type. Fixes:
512527
(`#35603 <https://github.com/llvm/llvm-project/issues/35603>`_)
513528
- Fix a crash when the using enum declaration uses an anonymous enumeration. Fixes (#GH86790).
529+
- Clang now correctly tracks type dependence of by-value captures in lambdas with an explicit
530+
object parameter.
531+
Fixes (#GH70604), (#GH79754), (#GH84163), (#GH84425), (#GH86054), (#GH86398), and (#GH86399).
514532

515533
Bug Fixes to AST Handling
516534
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -633,6 +651,7 @@ AST Matchers
633651
- Add ``isExplicitObjectMemberFunction``.
634652
- Fixed ``forEachArgumentWithParam`` and ``forEachArgumentWithParamType`` to
635653
not skip the explicit object parameter for operator calls.
654+
- Fixed captureVars assertion failure if not capturesVariables. (#GH76425)
636655

637656
clang-format
638657
------------

clang/include/clang/AST/ExprCXX.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ class CXXThisExpr : public Expr {
11491149
CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit, ExprValueKind VK)
11501150
: Expr(CXXThisExprClass, Ty, VK, OK_Ordinary) {
11511151
CXXThisExprBits.IsImplicit = IsImplicit;
1152+
CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = false;
11521153
CXXThisExprBits.Loc = L;
11531154
setDependence(computeDependence(this));
11541155
}
@@ -1170,6 +1171,15 @@ class CXXThisExpr : public Expr {
11701171
bool isImplicit() const { return CXXThisExprBits.IsImplicit; }
11711172
void setImplicit(bool I) { CXXThisExprBits.IsImplicit = I; }
11721173

1174+
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const {
1175+
return CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter;
1176+
}
1177+
1178+
void setCapturedByCopyInLambdaWithExplicitObjectParameter(bool Set) {
1179+
CXXThisExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = Set;
1180+
setDependence(computeDependence(this));
1181+
}
1182+
11731183
static bool classof(const Stmt *T) {
11741184
return T->getStmtClass() == CXXThisExprClass;
11751185
}

clang/include/clang/AST/Stmt.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,11 @@ class alignas(void *) Stmt {
784784
LLVM_PREFERRED_TYPE(bool)
785785
unsigned IsImplicit : 1;
786786

787+
/// Whether there is a lambda with an explicit object parameter that
788+
/// captures this "this" by copy.
789+
LLVM_PREFERRED_TYPE(bool)
790+
unsigned CapturedByCopyInLambdaWithExplicitObjectParameter : 1;
791+
787792
/// The location of the "this".
788793
SourceLocation Loc;
789794
};

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4961,6 +4961,8 @@ AST_MATCHER_P(LambdaExpr, hasAnyCapture, internal::Matcher<LambdaCapture>,
49614961
/// capturesVar(hasName("x")) matches `x` and `x = 1`.
49624962
AST_MATCHER_P(LambdaCapture, capturesVar, internal::Matcher<ValueDecl>,
49634963
InnerMatcher) {
4964+
if (!Node.capturesVariable())
4965+
return false;
49644966
auto *capturedVar = Node.getCapturedVar();
49654967
return capturedVar && InnerMatcher.matches(*capturedVar, Finder, Builder);
49664968
}

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,10 @@ class Spelling<string name, string variety, int version = 1> {
324324
}
325325

326326
class GNU<string name> : Spelling<name, "GNU">;
327-
class Declspec<string name> : Spelling<name, "Declspec"> {
328-
bit PrintOnLeft = 1;
329-
}
327+
class Declspec<string name> : Spelling<name, "Declspec">;
330328
class Microsoft<string name> : Spelling<name, "Microsoft">;
331329
class CXX11<string namespace, string name, int version = 1>
332330
: Spelling<name, "CXX11", version> {
333-
bit CanPrintOnLeft = 0;
334331
string Namespace = namespace;
335332
}
336333
class C23<string namespace, string name, int version = 1>
@@ -596,12 +593,6 @@ class AttrSubjectMatcherAggregateRule<AttrSubject subject> {
596593
def SubjectMatcherForNamed : AttrSubjectMatcherAggregateRule<Named>;
597594

598595
class Attr {
599-
// Specifies that when printed, this attribute is meaningful on the
600-
// 'left side' of the declaration.
601-
bit CanPrintOnLeft = 1;
602-
// Specifies that when printed, this attribute is required to be printed on
603-
// the 'left side' of the declaration.
604-
bit PrintOnLeft = 0;
605596
// The various ways in which an attribute can be spelled in source
606597
list<Spelling> Spellings;
607598
// The things to which an attribute can appertain
@@ -937,7 +928,6 @@ def AVRSignal : InheritableAttr, TargetSpecificAttr<TargetAVR> {
937928
}
938929

939930
def AsmLabel : InheritableAttr {
940-
let CanPrintOnLeft = 0;
941931
let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm__">];
942932
let Args = [
943933
// Label specifies the mangled name for the decl.
@@ -1534,7 +1524,6 @@ def AllocSize : InheritableAttr {
15341524
}
15351525

15361526
def EnableIf : InheritableAttr {
1537-
let CanPrintOnLeft = 0;
15381527
// Does not have a [[]] spelling because this attribute requires the ability
15391528
// to parse function arguments but the attribute is not written in the type
15401529
// position.
@@ -3171,7 +3160,6 @@ def Unavailable : InheritableAttr {
31713160
}
31723161

31733162
def DiagnoseIf : InheritableAttr {
3174-
let CanPrintOnLeft = 0;
31753163
// Does not have a [[]] spelling because this attribute requires the ability
31763164
// to parse function arguments but the attribute is not written in the type
31773165
// position.

clang/include/clang/Basic/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ clang_tablegen(AttrList.inc -gen-clang-attr-list
3131
SOURCE Attr.td
3232
TARGET ClangAttrList)
3333

34-
clang_tablegen(AttrLeftSideCanPrintList.inc -gen-clang-attr-can-print-left-list
35-
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
36-
SOURCE Attr.td
37-
TARGET ClangAttrCanPrintLeftList)
38-
39-
clang_tablegen(AttrLeftSideMustPrintList.inc -gen-clang-attr-must-print-left-list
40-
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
41-
SOURCE Attr.td
42-
TARGET ClangAttrMustPrintLeftList)
43-
4434
clang_tablegen(AttrSubMatchRulesList.inc -gen-clang-attr-subject-match-rule-list
4535
-I ${CMAKE_CURRENT_SOURCE_DIR}/../../
4636
SOURCE Attr.td

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7142,7 +7142,8 @@ def ext_typecheck_decl_incomplete_type : ExtWarn<
71427142
def err_tentative_def_incomplete_type : Error<
71437143
"tentative definition has type %0 that is never completed">;
71447144
def warn_tentative_incomplete_array : Warning<
7145-
"tentative array definition assumed to have one element">;
7145+
"tentative array definition assumed to have one element">,
7146+
InGroup<DiagGroup<"tentative-definition-array">>;
71467147
def err_typecheck_incomplete_array_needs_initializer : Error<
71477148
"definition of variable with array type needs an explicit size "
71487149
"or an initializer">;

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5439,7 +5439,8 @@ class Sema final : public SemaBase {
54395439

54405440
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R,
54415441
bool NeedsADL,
5442-
bool AcceptInvalidDecl = false);
5442+
bool AcceptInvalidDecl = false,
5443+
bool NeedUnresolved = false);
54435444
ExprResult BuildDeclarationNameExpr(
54445445
const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl *D,
54455446
NamedDecl *FoundD = nullptr,
@@ -6591,7 +6592,10 @@ class Sema final : public SemaBase {
65916592
SourceLocation RParenLoc);
65926593

65936594
//// ActOnCXXThis - Parse 'this' pointer.
6594-
ExprResult ActOnCXXThis(SourceLocation loc);
6595+
ExprResult ActOnCXXThis(SourceLocation Loc);
6596+
6597+
/// Check whether the type of 'this' is valid in the current context.
6598+
bool CheckCXXThisType(SourceLocation Loc, QualType Type);
65956599

65966600
/// Build a CXXThisExpr and mark it referenced in the current context.
65976601
Expr *BuildCXXThisExpr(SourceLocation Loc, QualType Type, bool IsImplicit);
@@ -10077,7 +10081,7 @@ class Sema final : public SemaBase {
1007710081

1007810082
/// Note that we are instantiating a type alias template declaration.
1007910083
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
10080-
TypeAliasTemplateDecl *Template,
10084+
TypeAliasTemplateDecl *Entity,
1008110085
ArrayRef<TemplateArgument> TemplateArgs,
1008210086
SourceRange InstantiationRange = SourceRange());
1008310087

clang/include/clang/Serialization/ASTReader.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,27 +1089,13 @@ class ASTReader
10891089
/// the last time we loaded information about this identifier.
10901090
llvm::DenseMap<IdentifierInfo *, unsigned> IdentifierGeneration;
10911091

1092-
class InterestingDecl {
1093-
Decl *D;
1094-
bool DeclHasPendingBody;
1095-
1096-
public:
1097-
InterestingDecl(Decl *D, bool HasBody)
1098-
: D(D), DeclHasPendingBody(HasBody) {}
1099-
1100-
Decl *getDecl() { return D; }
1101-
1102-
/// Whether the declaration has a pending body.
1103-
bool hasPendingBody() { return DeclHasPendingBody; }
1104-
};
1105-
11061092
/// Contains declarations and definitions that could be
11071093
/// "interesting" to the ASTConsumer, when we get that AST consumer.
11081094
///
11091095
/// "Interesting" declarations are those that have data that may
11101096
/// need to be emitted, such as inline function definitions or
11111097
/// Objective-C protocols.
1112-
std::deque<InterestingDecl> PotentiallyInterestingDecls;
1098+
std::deque<Decl *> PotentiallyInterestingDecls;
11131099

11141100
/// The list of deduced function types that we have not yet read, because
11151101
/// they might contain a deduced return type that refers to a local type

0 commit comments

Comments
 (0)