Skip to content

Commit 2046468

Browse files
authored
Merge branch 'main' into fix/147495
2 parents e2bb622 + 896575e commit 2046468

File tree

763 files changed

+74600
-98995
lines changed

Some content is hidden

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

763 files changed

+74600
-98995
lines changed

clang-tools-extra/clangd/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import lit.llvm
22

33
lit.llvm.initialize(lit_config, config)
4-
lit.llvm.llvm_config.use_clang([], [], required=False)
4+
lit.llvm.llvm_config.clang_setup()
55
lit.llvm.llvm_config.use_default_substitutions()
66

77
config.name = "Clangd"

clang-tools-extra/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
config.test_exec_root = os.path.join(config.clang_tools_binary_dir, "test")
4343

4444
# Tools need the same environment setup as clang (we don't need clang itself).
45-
llvm_config.use_clang(required=False)
45+
llvm_config.clang_setup()
4646

4747
if config.clang_tidy_staticanalyzer:
4848
config.available_features.add("static-analyzer")

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,10 @@ Improvements to Clang's diagnostics
662662
#GH142457, #GH139913, #GH138850, #GH137867, #GH137860, #GH107840, #GH93308,
663663
#GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490,
664664
#GH36703, #GH32903, #GH23312, #GH69874.
665+
666+
- Clang no longer emits a spurious -Wdangling-gsl warning in C++23 when
667+
iterating over an element of a temporary container in a range-based
668+
for loop.(#GH109793, #GH145164)
665669

666670
- Fixed false positives in ``-Wformat-truncation`` and ``-Wformat-overflow``
667671
diagnostics when floating-point numbers had both width field and plus or space
@@ -926,12 +930,17 @@ Bug Fixes to C++ Support
926930
- Fixed a crash when constant evaluating some explicit object member assignment operators. (#GH142835)
927931
- Fixed an access checking bug when substituting into concepts (#GH115838)
928932
- Fix a bug where private access specifier of overloaded function not respected. (#GH107629)
933+
- Correctly handles calling an explicit object member function template overload set
934+
through its address (``(&Foo::bar<baz>)()``).
929935
- Correctly handle allocations in the condition of a ``if constexpr``.(#GH120197) (#GH134820)
930936
- Fixed a crash when handling invalid member using-declaration in C++20+ mode. (#GH63254)
937+
- Fixed parsing of lambda expressions that appear after ``*`` or ``&`` in contexts where a declaration can appear. (#GH63880)
938+
- Fix name lookup in lambda appearing in the body of a requires expression. (#GH147650)
931939
- Fix a crash when trying to instantiate an ambiguous specialization. (#GH51866)
932940
- Improved handling of variables with ``consteval`` constructors, to
933941
consistently treat the initializer as manifestly constant-evaluated.
934942
(#GH135281)
943+
- Fix a crash in the presence of invalid base classes. (#GH147186)
935944

936945
Bug Fixes to AST Handling
937946
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1232,6 +1241,7 @@ OpenMP Support
12321241
- Fixed mapping of arrays of structs containing nested structs with user defined
12331242
mappers, by using compiler-generated default mappers for the outer structs for
12341243
such maps.
1244+
- Deprecation warning has been emitted for deprecated delimited form of ``declare target``.
12351245

12361246
Improvements
12371247
^^^^^^^^^^^^

clang/include/clang/AST/Decl.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,11 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
10901090

10911091
LLVM_PREFERRED_TYPE(bool)
10921092
unsigned IsCXXCondDecl : 1;
1093+
1094+
/// Whether this variable is the implicit __range variable in a for-range
1095+
/// loop.
1096+
LLVM_PREFERRED_TYPE(bool)
1097+
unsigned IsCXXForRangeImplicitVar : 1;
10931098
};
10941099

10951100
union {
@@ -1591,6 +1596,19 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
15911596
NonParmVarDeclBits.IsCXXCondDecl = true;
15921597
}
15931598

1599+
/// Whether this variable is the implicit '__range' variable in C++
1600+
/// range-based for loops.
1601+
bool isCXXForRangeImplicitVar() const {
1602+
return isa<ParmVarDecl>(this) ? false
1603+
: NonParmVarDeclBits.IsCXXForRangeImplicitVar;
1604+
}
1605+
1606+
void setCXXForRangeImplicitVar(bool FRV) {
1607+
assert(!isa<ParmVarDecl>(this) &&
1608+
"Cannot set IsCXXForRangeImplicitVar on ParmVarDecl");
1609+
NonParmVarDeclBits.IsCXXForRangeImplicitVar = FRV;
1610+
}
1611+
15941612
/// Determines if this variable's alignment is dependent.
15951613
bool hasDependentAlignment() const;
15961614

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,9 @@ def err_omp_declare_target_multiple : Error<
15741574
"%0 appears multiple times in clauses on the same declare target directive">;
15751575
def err_omp_declare_target_indirect_device_type: Error<
15761576
"only 'device_type(any)' clause is allowed with indirect clause">;
1577+
def warn_omp_deprecated_declare_target_delimited_form :
1578+
Warning<"the delimited form of '#pragma omp declare target' without clauses is deprecated; use '#pragma omp begin declare target' instead">,
1579+
InGroup<Deprecated>;
15771580
def err_omp_expected_clause: Error<
15781581
"expected at least one clause on '#pragma omp %0' directive">;
15791582
def err_omp_mapper_illegal_identifier : Error<

clang/include/clang/Basic/riscv_andes_vector.td

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,35 @@ let RequiredFeatures = ["xandesvbfhcvt"],
6464
}
6565
}
6666

67+
// Andes Vector INT4 Load Extension (XAndesVSIntLoad)
68+
69+
let SupportOverloading = false,
70+
UnMaskedPolicyScheme = HasPassthruOperand in {
71+
multiclass RVVVLN8Builtin {
72+
let Name = NAME # "_v",
73+
IRName = "nds_vln",
74+
MaskedIRName = "nds_vln_mask",
75+
OverloadedName = NAME in
76+
def : RVVOutOp0Builtin<"v", "vPC0", "c">;
77+
}
78+
}
79+
80+
let SupportOverloading = false,
81+
UnMaskedPolicyScheme = HasPassthruOperand in {
82+
multiclass RVVVLNU8Builtin {
83+
let Name = NAME # "_v",
84+
IRName = "nds_vlnu",
85+
MaskedIRName = "nds_vlnu_mask",
86+
OverloadedName = NAME in
87+
def : RVVOutOp0Builtin<"Uv", "UvPC0", "c">;
88+
}
89+
}
90+
91+
let RequiredFeatures = ["xandesvsintload"] in {
92+
defm nds_vln8 : RVVVLN8Builtin;
93+
defm nds_vlnu8 : RVVVLNU8Builtin;
94+
}
95+
6796
// Andes Vector Packed FP16 Extension (XAndesVPackFPH)
6897

6998
multiclass RVVFPMAD {

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -489,28 +489,28 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
489489
is 4 bits wide, starts at offset 0, and is signed.
490490
}];
491491
let parameters = (ins "mlir::StringAttr":$name,
492-
"mlir::Type":$storageType,
492+
"mlir::Type":$storage_type,
493493
"uint64_t":$size,
494494
"uint64_t":$offset,
495-
"bool":$isSigned);
495+
"bool":$is_signed);
496496

497497
let assemblyFormat = [{`<` struct($name,
498-
$storageType,
498+
$storage_type,
499499
$size,
500500
$offset,
501-
$isSigned)
501+
$is_signed)
502502
`>`
503503
}];
504504

505505
let builders = [
506506
AttrBuilder<(ins "llvm::StringRef":$name,
507-
"mlir::Type":$storageType,
507+
"mlir::Type":$storage_type,
508508
"uint64_t":$size,
509509
"uint64_t":$offset,
510-
"bool":$isSigned
510+
"bool":$is_signed
511511
), [{
512-
return $_get($_ctxt, mlir::StringAttr::get($_ctxt, name), storageType,
513-
size, offset, isSigned);
512+
return $_get($_ctxt, mlir::StringAttr::get($_ctxt, name), storage_type,
513+
size, offset, is_signed);
514514
}]>
515515
];
516516
}

clang/include/clang/Lex/TokenLexer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TokenLexer {
6565

6666
/// The offset of the macro expansion in the
6767
/// "source location address space".
68-
unsigned MacroStartSLocOffset;
68+
SourceLocation::UIntTy MacroStartSLocOffset;
6969

7070
/// Location of the macro definition.
7171
SourceLocation MacroDefStart;

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12501,6 +12501,7 @@ class Sema final : public SemaBase {
1250112501
sema::TemplateDeductionInfo &Info,
1250212502
SmallVectorImpl<OriginalCallArg> const *OriginalCallArgs,
1250312503
bool PartialOverloading, bool PartialOrdering,
12504+
bool ForOverloadSetAddressResolution,
1250412505
llvm::function_ref<bool(bool)> CheckNonDependent =
1250512506
[](bool /*OnlyInitializeNonUserDefinedConversions*/) {
1250612507
return false;
@@ -13318,18 +13319,6 @@ class Sema final : public SemaBase {
1331813319
/// \param ForDefaultArgumentSubstitution indicates we should continue looking
1331913320
/// when encountering a specialized member function template, rather than
1332013321
/// returning immediately.
13321-
void getTemplateInstantiationArgs(
13322-
MultiLevelTemplateArgumentList &Result, const NamedDecl *D,
13323-
const DeclContext *DC = nullptr, bool Final = false,
13324-
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,
13325-
bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr,
13326-
bool ForConstraintInstantiation = false,
13327-
bool SkipForSpecialization = false,
13328-
bool ForDefaultArgumentSubstitution = false);
13329-
13330-
/// This creates a new \p MultiLevelTemplateArgumentList and invokes the other
13331-
/// overload with it as the first parameter. Prefer this overload in most
13332-
/// situations.
1333313322
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(
1333413323
const NamedDecl *D, const DeclContext *DC = nullptr, bool Final = false,
1333513324
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,8 @@ bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm,
11961196
if (!CheckDynamicMemoryAllocation(S, OpPC))
11971197
return false;
11981198

1199+
DynamicAllocator &Allocator = S.getAllocator();
1200+
11991201
const Expr *Source = nullptr;
12001202
const Block *BlockToDelete = nullptr;
12011203
{
@@ -1212,6 +1214,21 @@ bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm,
12121214
while (Ptr.isBaseClass())
12131215
Ptr = Ptr.getBase();
12141216

1217+
Source = Ptr.getDeclDesc()->asExpr();
1218+
BlockToDelete = Ptr.block();
1219+
1220+
// Check that new[]/delete[] or new/delete were used, not a mixture.
1221+
const Descriptor *BlockDesc = BlockToDelete->getDescriptor();
1222+
if (std::optional<DynamicAllocator::Form> AllocForm =
1223+
Allocator.getAllocationForm(Source)) {
1224+
DynamicAllocator::Form DeleteForm =
1225+
DeleteIsArrayForm ? DynamicAllocator::Form::Array
1226+
: DynamicAllocator::Form::NonArray;
1227+
if (!CheckNewDeleteForms(S, OpPC, *AllocForm, DeleteForm, BlockDesc,
1228+
Source))
1229+
return false;
1230+
}
1231+
12151232
// For the non-array case, the types must match if the static type
12161233
// does not have a virtual destructor.
12171234
if (!DeleteIsArrayForm && Ptr.getType() != InitialType &&
@@ -1230,9 +1247,6 @@ bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm,
12301247
return false;
12311248
}
12321249

1233-
Source = Ptr.getDeclDesc()->asExpr();
1234-
BlockToDelete = Ptr.block();
1235-
12361250
if (!CheckDeleteSource(S, OpPC, Source, Ptr))
12371251
return false;
12381252

@@ -1266,24 +1280,14 @@ bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm,
12661280
if (!RunDestructors(S, OpPC, BlockToDelete))
12671281
return false;
12681282

1269-
DynamicAllocator &Allocator = S.getAllocator();
1270-
const Descriptor *BlockDesc = BlockToDelete->getDescriptor();
1271-
std::optional<DynamicAllocator::Form> AllocForm =
1272-
Allocator.getAllocationForm(Source);
1273-
12741283
if (!Allocator.deallocate(Source, BlockToDelete, S)) {
12751284
// Nothing has been deallocated, this must be a double-delete.
12761285
const SourceInfo &Loc = S.Current->getSource(OpPC);
12771286
S.FFDiag(Loc, diag::note_constexpr_double_delete);
12781287
return false;
12791288
}
12801289

1281-
assert(AllocForm);
1282-
DynamicAllocator::Form DeleteForm = DeleteIsArrayForm
1283-
? DynamicAllocator::Form::Array
1284-
: DynamicAllocator::Form::NonArray;
1285-
return CheckNewDeleteForms(S, OpPC, *AllocForm, DeleteForm, BlockDesc,
1286-
Source);
1290+
return true;
12871291
}
12881292

12891293
void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,

0 commit comments

Comments
 (0)