Skip to content

Commit a9175ca

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents 13f46a5 + 4d84d3d commit a9175ca

File tree

556 files changed

+177763
-7513
lines changed

Some content is hidden

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

556 files changed

+177763
-7513
lines changed

.clang-format-ignore

Whitespace-only changes.

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ genHTML(const EnumInfo &I, const ClangDocContext &CDCtx) {
716716

717717
maybeWriteSourceFileRef(Out, CDCtx, I.DefLoc);
718718

719-
std::string Description;
720719
if (!I.Description.empty())
721720
Out.emplace_back(genHTML(I.Description));
722721

@@ -759,7 +758,6 @@ genHTML(const FunctionInfo &I, const ClangDocContext &CDCtx,
759758

760759
maybeWriteSourceFileRef(Out, CDCtx, I.DefLoc);
761760

762-
std::string Description;
763761
if (!I.Description.empty())
764762
Out.emplace_back(genHTML(I.Description));
765763

@@ -777,7 +775,6 @@ genHTML(const NamespaceInfo &I, Index &InfoIndex, const ClangDocContext &CDCtx,
777775

778776
Out.emplace_back(std::make_unique<TagNode>(HTMLTag::TAG_H1, InfoTitle));
779777

780-
std::string Description;
781778
if (!I.Description.empty())
782779
Out.emplace_back(genHTML(I.Description));
783780

@@ -820,7 +817,6 @@ genHTML(const RecordInfo &I, Index &InfoIndex, const ClangDocContext &CDCtx,
820817

821818
maybeWriteSourceFileRef(Out, CDCtx, I.DefLoc);
822819

823-
std::string Description;
824820
if (!I.Description.empty())
825821
Out.emplace_back(genHTML(I.Description));
826822

clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ static std::optional<TemplateSpecializationTypeLoc>
5454
matchEnableIfSpecializationImplTypename(TypeLoc TheType) {
5555
if (const auto Dep = TheType.getAs<DependentNameTypeLoc>()) {
5656
const IdentifierInfo *Identifier = Dep.getTypePtr()->getIdentifier();
57+
ElaboratedTypeKeyword Keyword = Dep.getTypePtr()->getKeyword();
5758
if (!Identifier || Identifier->getName() != "type" ||
58-
Dep.getTypePtr()->getKeyword() != ElaboratedTypeKeyword::Typename) {
59+
(Keyword != ElaboratedTypeKeyword::Typename &&
60+
Keyword != ElaboratedTypeKeyword::None)) {
5961
return std::nullopt;
6062
}
6163
TheType = Dep.getQualifierLoc().getTypeLoc();
@@ -108,8 +110,10 @@ matchEnableIfSpecializationImplTrait(TypeLoc TheType) {
108110

109111
if (const auto *AliasedType =
110112
dyn_cast<DependentNameType>(Specialization->getAliasedType())) {
113+
ElaboratedTypeKeyword Keyword = AliasedType->getKeyword();
111114
if (AliasedType->getIdentifier()->getName() != "type" ||
112-
AliasedType->getKeyword() != ElaboratedTypeKeyword::Typename) {
115+
(Keyword != ElaboratedTypeKeyword::Typename &&
116+
Keyword != ElaboratedTypeKeyword::None)) {
113117
return std::nullopt;
114118
}
115119
} else {

clang-tools-extra/clangd/ConfigFragment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ struct Fragment {
347347
/// "IWYU": Include what you use. Insert the owning header for top-level
348348
/// symbols, unless the header is already directly included or the
349349
/// symbol is forward-declared
350-
/// "NeverInsert": Never insert headers
350+
/// "Never": Never insert headers
351351
std::optional<Located<std::string>> HeaderInsertion;
352352
};
353353
CompletionBlock Completion;

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ to ``float``; see below for more information on this emulation.
10001000
* SPIR (natively)
10011001
* X86 (if SSE2 is available; natively if AVX512-FP16 is also available)
10021002
* RISC-V (natively if Zfh or Zhinx is available)
1003+
* SystemZ (emulated)
10031004

10041005
* ``__bf16`` is supported on the following targets (currently never natively):
10051006

clang/docs/ReleaseNotes.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,14 @@ Improvements to Clang's diagnostics
371371
372372
- An error is now emitted when a ``musttail`` call is made to a function marked with the ``not_tail_called`` attribute. (#GH133509).
373373

374+
- ``-Whigher-precisision-for-complex-divison`` warns when:
375+
376+
- The divisor is complex.
377+
- When the complex division happens in a higher precision type due to arithmetic promotion.
378+
- When using the divide and assign operator (``/=``).
379+
380+
Fixes #GH131127
381+
374382
Improvements to Clang's time-trace
375383
----------------------------------
376384

@@ -417,6 +425,8 @@ Bug Fixes in This Version
417425
- Fixed a clang 20 regression where diagnostics attached to some calls to member functions
418426
using C++23 "deducing this" did not have a diagnostic location (#GH135522)
419427

428+
- Fixed a crash when a ``friend`` function is redefined as deleted. (#GH135506)
429+
420430
Bug Fixes to Compiler Builtins
421431
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
422432

@@ -461,6 +471,7 @@ Bug Fixes to C++ Support
461471
- Clang no longer crashes when trying to unify the types of arrays with
462472
certain differences in qualifiers (this could happen during template argument
463473
deduction or when building a ternary operator). (#GH97005)
474+
- Fixed type alias CTAD issues involving default template arguments. (#GH134471)
464475
- The initialization kind of elements of structured bindings
465476
direct-list-initialized from an array is corrected to direct-initialization.
466477
- Clang no longer crashes when a coroutine is declared ``[[noreturn]]``. (#GH127327)
@@ -476,6 +487,10 @@ Bug Fixes to C++ Support
476487
- Fixes matching of nested template template parameters. (#GH130362)
477488
- Correctly diagnoses template template paramters which have a pack parameter
478489
not in the last position.
490+
- Disallow overloading on struct vs class on dependent types, which is IFNDR, as
491+
this makes the problem diagnosable.
492+
- Improved preservation of the presence or abscence of typename specifier when
493+
printing types in diagnostics.
479494
- Clang now correctly parses ``if constexpr`` expressions in immediate function context. (#GH123524)
480495
- Fixed an assertion failure affecting code that uses C++23 "deducing this". (#GH130272)
481496
- Clang now properly instantiates destructors for initialized members within non-delegating constructors. (#GH93251)

clang/include/clang/AST/Type.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,6 +2838,20 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
28382838
/// immediately following this class.
28392839
template <typename T> const T *getAs() const;
28402840

2841+
/// Look through sugar for an instance of TemplateSpecializationType which
2842+
/// is not a type alias, or null if there is no such type.
2843+
/// This is used when you want as-written template arguments or the template
2844+
/// name for a class template specialization.
2845+
const TemplateSpecializationType *
2846+
getAsNonAliasTemplateSpecializationType() const;
2847+
2848+
const TemplateSpecializationType *
2849+
castAsNonAliasTemplateSpecializationType() const {
2850+
const auto *TST = getAsNonAliasTemplateSpecializationType();
2851+
assert(TST && "not a TemplateSpecializationType");
2852+
return TST;
2853+
}
2854+
28412855
/// Member-template getAsAdjusted<specific type>. Look through specific kinds
28422856
/// of sugar (parens, attributes, etc) for an instance of \<specific type>.
28432857
/// This is used when you need to walk over sugar nodes that represent some

clang/include/clang/Basic/AttrDocs.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,10 +1680,6 @@ translated into the LLVM ``convergent`` attribute, which indicates that the call
16801680
instructions of a function with this attribute cannot be made control-dependent
16811681
on any additional values.
16821682

1683-
In languages designed for SPMD/SIMT programming model, e.g. OpenCL or CUDA,
1684-
the call instructions of a function with this attribute must be executed by
1685-
all work items or threads in a work group or sub group.
1686-
16871683
This attribute is different from ``noduplicate`` because it allows duplicating
16881684
function calls if it can be proved that the duplicated function calls are
16891685
not made control-dependent on any additional values, e.g., unrolling a loop

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,9 @@ def HLSLExtension : DiagGroup<"hlsl-extensions", [HLSL202y]>;
16121612
// Warning for mix packoffset and non-packoffset.
16131613
def HLSLMixPackOffset : DiagGroup<"mix-packoffset">;
16141614

1615+
// Warning for implicit resource bindings.
1616+
def HLSLImplicitBinding : DiagGroup<"hlsl-implicit-binding">;
1617+
16151618
// Warnings for DXIL validation
16161619
def DXILValidation : DiagGroup<"dxil-validation">;
16171620

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12734,6 +12734,7 @@ def warn_hlsl_deprecated_register_type_i: Warning<"binding type 'i' ignored. The
1273412734
def err_hlsl_unsupported_register_number : Error<"register number should be an integer">;
1273512735
def err_hlsl_expected_space : Error<"invalid space specifier '%0' used; expected 'space' followed by an integer, like space1">;
1273612736
def err_hlsl_space_on_global_constant : Error<"register space cannot be specified on global constants">;
12737+
def warn_hlsl_implicit_binding : Warning<"resource has implicit register binding">, InGroup<HLSLImplicitBinding>, DefaultError;
1273712738
def warn_hlsl_packoffset_mix : Warning<"cannot mix packoffset elements with nonpackoffset elements in a cbuffer">,
1273812739
InGroup<HLSLMixPackOffset>;
1273912740
def err_hlsl_packoffset_overlap : Error<"packoffset overlap between %0, %1">;

0 commit comments

Comments
 (0)