Skip to content

Commit 5c53fa5

Browse files
rebase
Created using spr 1.3.7
2 parents ce24d18 + e64352f commit 5c53fa5

File tree

109 files changed

+2589
-668
lines changed

Some content is hidden

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

109 files changed

+2589
-668
lines changed

.github/renovate.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@
88
"minimumReleaseAge": "3 days",
99
"assignees": ["boomanaiden154"],
1010
"ignorePaths": [".github/workflows/containers/**"],
11-
"groupName": "[Github] Update GHA Dependencies"
11+
"groupName": "[Github] Update GHA Dependencies",
12+
"packageRules": [
13+
{
14+
"matchPackageNames": ["windows", "macos"],
15+
"matchManagers": ["github-actions"],
16+
"enabled": false
17+
}
18+
]
1219
}

.github/workflows/containers/github-action-ci-tooling/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN apt-get update && \
2222

2323
FROM docker.io/library/ubuntu:24.04 AS base
2424
ENV LLVM_SYSROOT=/opt/llvm
25+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
2526

2627
# Need nodejs for some of the GitHub actions.
2728
# Need git for git-clang-format.
@@ -53,7 +54,6 @@ COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/cla
5354
/llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format \
5455
${LLVM_SYSROOT}/bin/
5556

56-
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
5757

5858
# Install dependencies for 'pr-code-format.yml' job
5959
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
@@ -77,7 +77,6 @@ COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/cl
7777
RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \
7878
ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++
7979

80-
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
8180

8281
RUN apt-get update && \
8382
DEBIAN_FRONTEND=noninteractive apt-get install -y \

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ Bug Fixes in This Version
447447
- Fixed a failed assertion with empty filename in ``#embed`` directive. (#GH162951)
448448
- Fixed a crash triggered by unterminated ``__has_embed``. (#GH162953)
449449
- Accept empty enumerations in MSVC-compatible C mode. (#GH114402)
450+
- Fixed false-positive shadow diagnostics for lambdas in explicit object member functions. (#GH163731)
450451

451452
Bug Fixes to Compiler Builtins
452453
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ def warn_drv_yc_multiple_inputs_clang_cl : Warning<
312312
def warn_drv_potentially_misspelled_joined_argument : Warning<
313313
"joined argument treated as '%0'; did you mean '%1'?">, InGroup<UnknownArgument>;
314314

315+
def err_drv_too_many_actions: Error<
316+
"only one action option is allowed. Got %0">;
315317
def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
316318
def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
317319
def err_drv_invalid_value_with_suggestion : Error<

clang/include/clang/Sema/Sema.h

Lines changed: 60 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -11309,9 +11309,6 @@ class Sema final : public SemaBase {
1130911309
InventedParameterInfos.end());
1131011310
}
1131111311

11312-
/// The number of SFINAE diagnostics that have been trapped.
11313-
unsigned NumSFINAEErrors;
11314-
1131511312
ArrayRef<sema::FunctionScopeInfo *> getFunctionScopes() const {
1131611313
return llvm::ArrayRef(FunctionScopes.begin() + FunctionScopesStart,
1131711314
FunctionScopes.end());
@@ -12385,49 +12382,65 @@ class Sema final : public SemaBase {
1238512382
///@{
1238612383

1238712384
public:
12388-
/// When true, access checking violations are treated as SFINAE
12389-
/// failures rather than hard errors.
12390-
bool AccessCheckingSFINAE;
12385+
class SFINAETrap;
12386+
12387+
struct SFINAEContextBase {
12388+
SFINAEContextBase(Sema &S, SFINAETrap *Cur)
12389+
: S(S), Prev(std::exchange(S.CurrentSFINAEContext, Cur)) {}
12390+
12391+
protected:
12392+
Sema &S;
12393+
~SFINAEContextBase() { S.CurrentSFINAEContext = Prev; }
12394+
12395+
private:
12396+
SFINAETrap *Prev;
12397+
};
12398+
12399+
struct NonSFINAEContext : SFINAEContextBase {
12400+
NonSFINAEContext(Sema &S) : SFINAEContextBase(S, nullptr) {}
12401+
};
1239112402

1239212403
/// RAII class used to determine whether SFINAE has
1239312404
/// trapped any errors that occur during template argument
1239412405
/// deduction.
12395-
class SFINAETrap {
12396-
Sema &SemaRef;
12397-
unsigned PrevSFINAEErrors;
12398-
bool PrevInNonInstantiationSFINAEContext;
12399-
bool PrevAccessCheckingSFINAE;
12400-
bool PrevLastDiagnosticIgnored;
12406+
class SFINAETrap : SFINAEContextBase {
12407+
bool HasErrorOcurred = false;
12408+
bool WithAccessChecking = false;
12409+
bool PrevLastDiagnosticIgnored =
12410+
S.getDiagnostics().isLastDiagnosticIgnored();
12411+
sema::TemplateDeductionInfo *DeductionInfo = nullptr;
12412+
12413+
SFINAETrap(Sema &S, sema::TemplateDeductionInfo *Info,
12414+
bool WithAccessChecking)
12415+
: SFINAEContextBase(S, this), WithAccessChecking(WithAccessChecking),
12416+
DeductionInfo(Info) {}
1240112417

1240212418
public:
12403-
/// \param ForValidityCheck If true, discard all diagnostics (from the
12419+
/// \param WithAccessChecking If true, discard all diagnostics (from the
1240412420
/// immediate context) instead of adding them to the currently active
12405-
/// \ref TemplateDeductionInfo (as returned by \ref isSFINAEContext).
12406-
explicit SFINAETrap(Sema &SemaRef, bool ForValidityCheck = false)
12407-
: SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
12408-
PrevInNonInstantiationSFINAEContext(
12409-
SemaRef.InNonInstantiationSFINAEContext),
12410-
PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
12411-
PrevLastDiagnosticIgnored(
12412-
SemaRef.getDiagnostics().isLastDiagnosticIgnored()) {
12413-
if (ForValidityCheck || !SemaRef.isSFINAEContext())
12414-
SemaRef.InNonInstantiationSFINAEContext = true;
12415-
SemaRef.AccessCheckingSFINAE = ForValidityCheck;
12416-
}
12421+
/// \ref TemplateDeductionInfo.
12422+
explicit SFINAETrap(Sema &S, bool WithAccessChecking = false)
12423+
: SFINAETrap(S, /*Info=*/nullptr, WithAccessChecking) {}
12424+
12425+
SFINAETrap(Sema &S, sema::TemplateDeductionInfo &Info)
12426+
: SFINAETrap(S, &Info, /*WithAccessChecking=*/false) {}
1241712427

1241812428
~SFINAETrap() {
12419-
SemaRef.NumSFINAEErrors = PrevSFINAEErrors;
12420-
SemaRef.InNonInstantiationSFINAEContext =
12421-
PrevInNonInstantiationSFINAEContext;
12422-
SemaRef.AccessCheckingSFINAE = PrevAccessCheckingSFINAE;
12423-
SemaRef.getDiagnostics().setLastDiagnosticIgnored(
12424-
PrevLastDiagnosticIgnored);
12429+
S.getDiagnostics().setLastDiagnosticIgnored(PrevLastDiagnosticIgnored);
1242512430
}
1242612431

12427-
/// Determine whether any SFINAE errors have been trapped.
12428-
bool hasErrorOccurred() const {
12429-
return SemaRef.NumSFINAEErrors > PrevSFINAEErrors;
12432+
SFINAETrap(const SFINAETrap &) = delete;
12433+
SFINAETrap &operator=(const SFINAETrap &) = delete;
12434+
12435+
sema::TemplateDeductionInfo *getDeductionInfo() const {
12436+
return DeductionInfo;
1243012437
}
12438+
12439+
/// Determine whether any SFINAE errors have been trapped.
12440+
bool hasErrorOccurred() const { return HasErrorOcurred; }
12441+
void setErrorOccurred() { HasErrorOcurred = true; }
12442+
12443+
bool withAccessChecking() const { return WithAccessChecking; }
1243112444
};
1243212445

1243312446
/// RAII class used to indicate that we are performing provisional
@@ -13148,9 +13161,6 @@ class Sema final : public SemaBase {
1314813161
PartialOrderingTTP,
1314913162
} Kind;
1315013163

13151-
/// Was the enclosing context a non-instantiation SFINAE context?
13152-
bool SavedInNonInstantiationSFINAEContext;
13153-
1315413164
/// Whether we're substituting into constraints.
1315513165
bool InConstraintSubstitution;
1315613166

@@ -13195,22 +13205,15 @@ class Sema final : public SemaBase {
1319513205
return {TemplateArgs, NumTemplateArgs};
1319613206
}
1319713207

13198-
/// The template deduction info object associated with the
13199-
/// substitution or checking of explicit or deduced template arguments.
13200-
sema::TemplateDeductionInfo *DeductionInfo;
13201-
1320213208
/// The source range that covers the construct that cause
1320313209
/// the instantiation, e.g., the template-id that causes a class
1320413210
/// template instantiation.
1320513211
SourceRange InstantiationRange;
1320613212

1320713213
CodeSynthesisContext()
13208-
: Kind(TemplateInstantiation),
13209-
SavedInNonInstantiationSFINAEContext(false),
13210-
InConstraintSubstitution(false),
13214+
: Kind(TemplateInstantiation), InConstraintSubstitution(false),
1321113215
InParameterMappingSubstitution(false), Entity(nullptr),
13212-
Template(nullptr), TemplateArgs(nullptr), NumTemplateArgs(0),
13213-
DeductionInfo(nullptr) {}
13216+
Template(nullptr), TemplateArgs(nullptr), NumTemplateArgs(0) {}
1321413217

1321513218
/// Determines whether this template is an actual instantiation
1321613219
/// that should be counted toward the maximum instantiation depth.
@@ -13262,15 +13265,13 @@ class Sema final : public SemaBase {
1326213265
FunctionTemplateDecl *FunctionTemplate,
1326313266
ArrayRef<TemplateArgument> TemplateArgs,
1326413267
CodeSynthesisContext::SynthesisKind Kind,
13265-
sema::TemplateDeductionInfo &DeductionInfo,
1326613268
SourceRange InstantiationRange = SourceRange());
1326713269

1326813270
/// Note that we are instantiating as part of template
1326913271
/// argument deduction for a class template declaration.
1327013272
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1327113273
TemplateDecl *Template,
1327213274
ArrayRef<TemplateArgument> TemplateArgs,
13273-
sema::TemplateDeductionInfo &DeductionInfo,
1327413275
SourceRange InstantiationRange = SourceRange());
1327513276

1327613277
/// Note that we are instantiating as part of template
@@ -13279,7 +13280,6 @@ class Sema final : public SemaBase {
1327913280
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1328013281
ClassTemplatePartialSpecializationDecl *PartialSpec,
1328113282
ArrayRef<TemplateArgument> TemplateArgs,
13282-
sema::TemplateDeductionInfo &DeductionInfo,
1328313283
SourceRange InstantiationRange = SourceRange());
1328413284

1328513285
/// Note that we are instantiating as part of template
@@ -13288,7 +13288,6 @@ class Sema final : public SemaBase {
1328813288
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1328913289
VarTemplatePartialSpecializationDecl *PartialSpec,
1329013290
ArrayRef<TemplateArgument> TemplateArgs,
13291-
sema::TemplateDeductionInfo &DeductionInfo,
1329213291
SourceRange InstantiationRange = SourceRange());
1329313292

1329413293
/// Note that we are instantiating a default argument for a function
@@ -13334,7 +13333,6 @@ class Sema final : public SemaBase {
1333413333
/// concept.
1333513334
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1333613335
ConstraintSubstitution, NamedDecl *Template,
13337-
sema::TemplateDeductionInfo &DeductionInfo,
1333813336
SourceRange InstantiationRange);
1333913337

1334013338
struct ConstraintNormalization {};
@@ -13354,7 +13352,6 @@ class Sema final : public SemaBase {
1335413352
/// a requirement of a requires expression.
1335513353
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1335613354
concepts::Requirement *Req,
13357-
sema::TemplateDeductionInfo &DeductionInfo,
1335813355
SourceRange InstantiationRange = SourceRange());
1335913356

1336013357
/// \brief Note that we are checking the satisfaction of the constraint
@@ -13366,7 +13363,6 @@ class Sema final : public SemaBase {
1336613363
/// \brief Note that we are checking a requires clause.
1336713364
InstantiatingTemplate(Sema &SemaRef, SourceLocation PointOfInstantiation,
1336813365
const RequiresExpr *E,
13369-
sema::TemplateDeductionInfo &DeductionInfo,
1337013366
SourceRange InstantiationRange);
1337113367

1337213368
struct BuildingDeductionGuidesTag {};
@@ -13399,8 +13395,7 @@ class Sema final : public SemaBase {
1339913395
SourceLocation PointOfInstantiation,
1340013396
SourceRange InstantiationRange, Decl *Entity,
1340113397
NamedDecl *Template = nullptr,
13402-
ArrayRef<TemplateArgument> TemplateArgs = {},
13403-
sema::TemplateDeductionInfo *DeductionInfo = nullptr);
13398+
ArrayRef<TemplateArgument> TemplateArgs = {});
1340413399

1340513400
InstantiatingTemplate(const InstantiatingTemplate &) = delete;
1340613401

@@ -13541,12 +13536,7 @@ class Sema final : public SemaBase {
1354113536
/// recent visible declaration of that namespace.
1354213537
llvm::DenseMap<NamedDecl *, NamedDecl *> VisibleNamespaceCache;
1354313538

13544-
/// Whether we are in a SFINAE context that is not associated with
13545-
/// template instantiation.
13546-
///
13547-
/// This is used when setting up a SFINAE trap (\c see SFINAETrap) outside
13548-
/// of a template instantiation or template argument deduction.
13549-
bool InNonInstantiationSFINAEContext;
13539+
SFINAETrap *CurrentSFINAEContext = nullptr;
1355013540

1355113541
/// The number of \p CodeSynthesisContexts that are not template
1355213542
/// instantiations and, therefore, should not be counted as part of the
@@ -13617,15 +13607,13 @@ class Sema final : public SemaBase {
1361713607
PrintInstantiationStack(getDefaultDiagFunc());
1361813608
}
1361913609

13620-
/// Determines whether we are currently in a context where
13621-
/// template argument substitution failures are not considered
13622-
/// errors.
13623-
///
13624-
/// \returns An empty \c Optional if we're not in a SFINAE context.
13625-
/// Otherwise, contains a pointer that, if non-NULL, contains the nearest
13626-
/// template-deduction context object, which can be used to capture
13627-
/// diagnostics that will be suppressed.
13628-
std::optional<sema::TemplateDeductionInfo *> isSFINAEContext() const;
13610+
/// Returns a pointer to the current SFINAE context, if any.
13611+
[[nodiscard]] SFINAETrap *getSFINAEContext() const {
13612+
return CurrentSFINAEContext;
13613+
}
13614+
[[nodiscard]] bool isSFINAEContext() const {
13615+
return CurrentSFINAEContext != nullptr;
13616+
}
1362913617

1363013618
/// Perform substitution on the type T with a given set of template
1363113619
/// arguments.
@@ -14637,7 +14625,8 @@ class Sema final : public SemaBase {
1463714625
ArrayRef<UnexpandedParameterPack> Unexpanded,
1463814626
const MultiLevelTemplateArgumentList &TemplateArgs,
1463914627
bool FailOnPackProducingTemplates, bool &ShouldExpand,
14640-
bool &RetainExpansion, UnsignedOrNone &NumExpansions);
14628+
bool &RetainExpansion, UnsignedOrNone &NumExpansions,
14629+
bool Diagnose = true);
1464114630

1464214631
/// Determine the number of arguments in the given pack expansion
1464314632
/// type.

clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,78 +1073,6 @@ float3 f16tof32(uint3);
10731073
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_f16tof32)
10741074
float4 f16tof32(uint4);
10751075

1076-
//===----------------------------------------------------------------------===//
1077-
// firstbithigh builtins
1078-
//===----------------------------------------------------------------------===//
1079-
1080-
/// \fn T firstbithigh(T Val)
1081-
/// \brief Returns the location of the first set bit starting from the highest
1082-
/// order bit and working downward, per component.
1083-
/// \param Val the input value.
1084-
1085-
#ifdef __HLSL_ENABLE_16_BIT
1086-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1087-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1088-
uint firstbithigh(int16_t);
1089-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1090-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1091-
uint2 firstbithigh(int16_t2);
1092-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1093-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1094-
uint3 firstbithigh(int16_t3);
1095-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1096-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1097-
uint4 firstbithigh(int16_t4);
1098-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1099-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1100-
uint firstbithigh(uint16_t);
1101-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1102-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1103-
uint2 firstbithigh(uint16_t2);
1104-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1105-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1106-
uint3 firstbithigh(uint16_t3);
1107-
_HLSL_AVAILABILITY(shadermodel, 6.2)
1108-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1109-
uint4 firstbithigh(uint16_t4);
1110-
#endif
1111-
1112-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1113-
uint firstbithigh(int);
1114-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1115-
uint2 firstbithigh(int2);
1116-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1117-
uint3 firstbithigh(int3);
1118-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1119-
uint4 firstbithigh(int4);
1120-
1121-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1122-
uint firstbithigh(uint);
1123-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1124-
uint2 firstbithigh(uint2);
1125-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1126-
uint3 firstbithigh(uint3);
1127-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1128-
uint4 firstbithigh(uint4);
1129-
1130-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1131-
uint firstbithigh(int64_t);
1132-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1133-
uint2 firstbithigh(int64_t2);
1134-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1135-
uint3 firstbithigh(int64_t3);
1136-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1137-
uint4 firstbithigh(int64_t4);
1138-
1139-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1140-
uint firstbithigh(uint64_t);
1141-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1142-
uint2 firstbithigh(uint64_t2);
1143-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1144-
uint3 firstbithigh(uint64_t3);
1145-
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_firstbithigh)
1146-
uint4 firstbithigh(uint64_t4);
1147-
11481076
//===----------------------------------------------------------------------===//
11491077
// firstbitlow builtins
11501078
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)