Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
9326633
[lldb] Remove PATH workaround for Android (#124682)
brad0 Jan 29, 2025
51c7338
[clang][bytecode] Fix dummy handling for p2280r4 (#124396)
tbaederr Jan 29, 2025
e811cb0
[flang] Implement !DIR$ UNROLL [N] (#123331)
JDPailleux Jan 29, 2025
5a34e6f
[flang] Implement CHDIR intrinsic (#124280)
JDPailleux Jan 29, 2025
e902cf2
[LLD][COFF] Write both native and EC export symbols to the import lib…
cjacek Jan 29, 2025
1ac3665
[clang] Restrict the use of scalar types in vector builtins (#119423)
frasercrmck Jan 29, 2025
2a1f795
[MLIR] Fix import of invokes with mismatched variadic types (#124828)
xlauko Jan 29, 2025
776ef9d
[LoopVectorize][NFC] Regenerate some early exit test CHECK lines (#12…
david-arm Jan 29, 2025
9ea64dd
[lldb] Make Python >= 3.8 required for LLDB 21 (#124735)
DavidSpickett Jan 29, 2025
db567ea
[lldb][NFC] Format part of ScriptInterpreterPython.cpp
DavidSpickett Jan 29, 2025
89e767f
[LoopIdiom] Move up atomic checks for memcpy/memmove (NFC) (#124535)
kasuga-fj Jan 29, 2025
e80d934
[MCJIT][test] Move remaining MCJIT interpreter tests to Interpreter/ …
asb Jan 29, 2025
89ca3e7
[CostModel][X86] Reduce worst case v8i16/v16i8 SSE2 shuffle costs (#1…
RKSimon Jan 29, 2025
690f251
[LoopInterchange] Handle LE and GE correctly (#124901)
kasuga-fj Jan 29, 2025
f20b8e3
[MLIR][Linalg] Fixes for Winograd decomposition and for tiling (#123675)
d-smirnov Jan 29, 2025
5e43418
[ARM] Forbid use of TLS with execute-only (#124806)
ostannard Jan 29, 2025
36b3c43
[AArch64] PAUTH_PROLOGUE should not be duplicated with PAuthLR (#124775)
ostannard Jan 29, 2025
2b55ef1
[VPlan] Add helper to run VPlan passes, verify after run (NFC). (#123…
fhahn Jan 29, 2025
ecc71de
[flang] Implement IERRNO intrinsic (#124281)
JDPailleux Jan 29, 2025
12cdf43
[libclc] Move (add|sub)_sat to CLC; optimize (#124903)
frasercrmck Jan 29, 2025
9534d27
[X86] vector-idiv-sdiv-512.ll - regenerate VPTERNLOG comments
RKSimon Jan 29, 2025
87782b2
[mlir][x86vector] AVX512-BF16 Dot op (#124800)
adam-smnk Jan 29, 2025
2f40145
[RISCV][TTI]Use processShuffleMasks for cost estimations/actual per-r…
alexey-bataev Jan 29, 2025
8d6b241
[mlir] Make `TypedStrAttr` actually enforce the string type. (#124770)
ingomueller-net Jan 29, 2025
983562d
[AMDGPU][NFC] Simplify t16/fake16 TableGen definitions. (#122693)
kosarev Jan 29, 2025
66e0498
[GlobalISel] Do not run verifier after ResetMachineFunctionPass (#124…
davemgreen Jan 29, 2025
978e083
[OpenMP] Allow OMP6.0 features. (#122108)
zahiraam Jan 29, 2025
3a29dfe
[LLVM][AMDGPU] Add Intrinsic and Builtin for ds_bpermute_fi_b32 (#124…
Acim-Maravic Jan 29, 2025
008e162
[mlir][x86vector] Restrict BF16 dot test to x86 (#124916)
adam-smnk Jan 29, 2025
d412fe5
[Offload] Enable mlir and flang in bot build (#124915)
jplehr Jan 29, 2025
86e20b0
[libcxx] Use _ftelli64/_fseeki64 on Windows (#123128)
mstorsjo Jan 29, 2025
058d183
[mlir][spirv] Make ConvertToSPIRVPass into a test pass (non-public) (…
andfau-amd Jan 29, 2025
cf37ae5
[InstCombine] Add one-use check when folding fabs over selects (#122270)
dtcxzyw Jan 29, 2025
7441e87
[libclc] Move several integer functions to CLC library (#116786)
frasercrmck Jan 29, 2025
4a1a697
[SLP][NFC]Unify ScalarToTreeEntries and MultiNodeScalars, NFC
alexey-bataev Jan 29, 2025
4573c85
Revert "[mlir][spirv] Make ConvertToSPIRVPass into a test pass (non-p…
andfau-amd Jan 29, 2025
ce96c26
Revert "[llvm][DebugInfo] Attach object-pointer to DISubprogram decla…
dwblaikie Jan 29, 2025
2e43f39
[NFC][SIWholeQuadMode] Perform less lookups (#124927)
jmmartinez Jan 29, 2025
5a4945f
[RISCV][SIFIVE] Fix latencies for vector integer arithmetic long late…
michaelmaitland Jan 29, 2025
25ae1a2
[mlir][spirv] Make ConvertToSPIRVPass into a test pass (non-public)
andfau-amd Jan 29, 2025
e9c2e0a
[AArch64] Match GCC behaviour for zero-size structs (#124760)
ostannard Jan 29, 2025
39a72be
[Clang] [NFC] Introduce `ConstDynamicRecursiveASTVisitor` (reland) (#…
Sirraide Jan 29, 2025
f226cab
[ValueTracking] Handle nonnull attributes at callsite (#124908)
dtcxzyw Jan 29, 2025
a01097f
[mlir][spirv] Add definition for VectorTimesMatrixOp (#124571)
IgWod-IMG Jan 29, 2025
bfabd5b
[libc++] Remove some private symbols from the ABI (#121497)
philnik777 Jan 29, 2025
540402c
[sanitizer_common] Remove workarounds for older Android (#124881)
brad0 Jan 29, 2025
349eab1
[asan] Enable wait4 test on Android (#124879)
brad0 Jan 29, 2025
0c63ec5
[NFC][SIWholeQuadMode] Remove redundant arguments (#124930)
jmmartinez Jan 29, 2025
a34a087
[clang][bytecode] Handle non-primitive vector element types (#124926)
tbaederr Jan 29, 2025
c583df4
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124882)
kazutakahirata Jan 29, 2025
7ab8f28
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124883)
kazutakahirata Jan 29, 2025
8e4c5cb
[Serialization] Migrate away from PointerUnion::dyn_cast (NFC) (#124884)
kazutakahirata Jan 29, 2025
8baa0d9
[CodeGen] Avoid repeated hash lookups (NFC) (#124885)
kazutakahirata Jan 29, 2025
3c3c850
[ReachingDefAnalysis] Extend the analysis to stack objects. (#118097)
mgudim Jan 29, 2025
29441e4
[IR] Convert from nocapture to captures(none) (#123181)
nikic Jan 29, 2025
382d359
[flang][cuda] Propagate the data attribute on the converted calls (#1…
clementval Jan 29, 2025
4fc514a
[MLIR][LLVM] Fix import of dso_local attribute (#124822)
ghehg Jan 29, 2025
6900768
[mlir][Conversion] Fix typos in MemRef descriptor comments (#124923)
matthias-springer Jan 29, 2025
3ce97e4
[ReachingDefAnalysis][NFC] Use at instead of lookup for DenseMap access
michaelmaitland Jan 29, 2025
35defdf
Revert "[ReachingDefAnalysis][NFC] Use at instead of lookup for Dense…
michaelmaitland Jan 29, 2025
8a43d0e
[Attributor] Check correct IRPosition in AANoCapture::isImpliedByIR()
nikic Jan 29, 2025
67752f6
[libc++] Simplify vector<bool>::__construct_at_end (#119632)
winner245 Jan 29, 2025
e0054e9
[MLIR][OpenMP] Emit nullary check for mapped pointer members and appr…
agozillon Jan 29, 2025
9adc99b
[AMDGPU] Always emit SI_KILL_I1_PSEUDO for uniform floating point bra…
kmitropoulou Jan 29, 2025
d444558
[bazel] Port 25ae1a266d50f24a8fffc57152d7f3c3fcb65517
d0k Jan 29, 2025
88e0014
[PhaseOrdering][X86] Add additional hadd/hsub test coverage
RKSimon Jan 29, 2025
0d4efa2
[MLIR][Linalg] Introduce linalg.contract (#123618)
rolfmorel Jan 29, 2025
15412d7
[clang-tidy] Refactor: remove typos in 'AllowedTypes' option in vario…
vbvictor Jan 29, 2025
18f8106
[KernelInfo] Implement new LLVM IR pass for GPU code analysis (#102944)
jdenny-ornl Jan 29, 2025
7fff252
[PowerPC] Use SelectionDAG::makeEquivalentMemoryOrdering(). NFC (#124…
topperc Jan 29, 2025
27e01d1
[X86] Use new Flags argument to storeRegToStackSlot to simplify code.…
topperc Jan 29, 2025
aa29521
Fix typo "tranpose" (#124929)
jayfoad Jan 29, 2025
c859323
[flang][OpenMP] Make parsing of trait properties more context-sensiti…
kparzysz Jan 29, 2025
5dae05f
Fix MSVC signed/unsigned mismatch warning. NFC.
RKSimon Jan 29, 2025
bda1976
[gn build] Port 18f8106f310e
llvmgnsyncbot Jan 29, 2025
ae6d5dd
[MemProf] Prune unneeded non-cold contexts (#124823)
teresajohnson Jan 29, 2025
953354c
[KernelInfo] Fix layering violation, Analysis cannot depend on Passes
d0k Jan 29, 2025
57f1731
[KernelInfo] Remove unused include.
d0k Jan 29, 2025
1822462
[InstCombine][VectorCombine][NFC] Move a test from InstCombine to (#1…
mgudim Jan 29, 2025
d3161de
[PassBuilder] VectorizerEnd Extension Points (#123494)
axelcool1234 Jan 29, 2025
8a334af
[clang] Remove the deprecated flag `-frelaxed-template-template-args`…
mizvekov Jan 29, 2025
b870875
[flang] Allow non-index length parameter on exprs fed into hlfir.get_…
vzakhari Jan 29, 2025
bac9575
[flang] Reset all extents to zero for empty hlfir.elemental loops. (#…
vzakhari Jan 29, 2025
a368402
[ExtractAPI] merge anon declarators even if they're array types (#120…
QuietMisdreavus Jan 29, 2025
bcf306e
[libc] Update include directory for libcMPCWrapper target when LIBC_M…
lntue Jan 29, 2025
07a0e2b
[clang] Track function template instantiation from definition (#112241)
mizvekov Jan 29, 2025
608012a
[libc++] Simplify the implementation of iostream.cpp (#124103)
philnik777 Jan 29, 2025
abc8812
[Clang][P1061] Add stuctured binding packs (#121417)
ricejasonf Jan 29, 2025
15ab7be
[flang][OpenMP] Parse WHEN, OTHERWISE, MATCH clauses plus METADIRECTI…
kparzysz Jan 29, 2025
ab1ee91
[flang][cuda] Remove the need of special compile definition for CUFIn…
clementval Jan 29, 2025
61ea63b
[Hexagon] Add support for decoding PLT symbols (#123425)
quic-areg Jan 29, 2025
46f9cdd
[DA] enable update_analyze_test_checks.py (#123435)
sebpop Jan 29, 2025
05e7f0e
[AutoBump] Merge with 46f9cddf (Jan 29)
jorickert May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Options

A semicolon-separated list of the names of functions or methods to be
considered as not having side-effects. Regular expressions are accepted,
e.g. `[Rr]ef(erence)?$` matches every type with suffix `Ref`, `ref`,
`Reference` and `reference`. The default is empty. If a name in the list
contains the sequence `::` it is matched against the qualified typename
(i.e. `namespace::Type`, otherwise it is matched against only
the type name (i.e. `Type`).
e.g. ``[Rr]ef(erence)?$`` matches every type with suffix ``Ref``, ``ref``,
``Reference`` and ``reference``. The default is empty. If a name in the list
contains the sequence `::` it is matched against the qualified type name
(i.e. ``namespace::Type``), otherwise it is matched against only
the type name (i.e. ``Type``).
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ Options

.. option:: WarnOnAllAutoCopies

When `true`, warns on any use of `auto` as the type of the range-based for
When `true`, warns on any use of ``auto`` as the type of the range-based for
loop variable. Default is `false`.

.. option:: AllowedTypes

A semicolon-separated list of names of types allowed to be copied in each
iteration. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
is empty. If a name in the list contains the sequence `::` it is matched
against the qualified typename (i.e. `namespace::Type`, otherwise it is
matched against only the type name (i.e. `Type`).
iteration. Regular expressions are accepted, e.g. ``[Rr]ef(erence)?$``
matches every type with suffix ``Ref``, ``ref``, ``Reference`` and
``reference``. The default is empty. If a name in the list contains the
sequence `::`, it is matched against the qualified type name
(i.e. ``namespace::Type``), otherwise it is matched against only the
type name (i.e. ``Type``).
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ Options
.. option:: AllowedTypes

A semicolon-separated list of names of types allowed to be initialized by
copying. Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches
every type with suffix `Ref`, `ref`, `Reference` and `reference`. The default
is empty. If a name in the list contains the sequence `::` it is matched
against the qualified typename (i.e. `namespace::Type`, otherwise it is
matched against only the type name (i.e. `Type`).
copying. Regular expressions are accepted, e.g. ``[Rr]ef(erence)?$`` matches
every type with suffix ``Ref``, ``ref``, ``Reference`` and ``reference``.
The default is empty. If a name in the list contains the sequence `::`, it
is matched against the qualified type name (i.e. ``namespace::Type``),
otherwise it is matched against only the type name (i.e. ``Type``).

.. option:: ExcludedContainerTypes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Options
.. option:: AllowedTypes

A semicolon-separated list of names of types allowed to be passed by value.
Regular expressions are accepted, e.g. `[Rr]ef(erence)?$` matches every type
with suffix `Ref`, `ref`, `Reference` and `reference`. The default is
empty. If a name in the list contains the sequence `::` it is matched against
the qualified typename (i.e. `namespace::Type`, otherwise it is matched
against only the type name (i.e. `Type`).
Regular expressions are accepted, e.g. ``[Rr]ef(erence)?$`` matches every
type with suffix ``Ref``, ``ref``, ``Reference`` and ``reference``. The
default is empty. If a name in the list contains the sequence `::`, it is
matched against the qualified type name (i.e. ``namespace::Type``),
otherwise it is matched against only the type name (i.e. ``Type``).
3 changes: 3 additions & 0 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@ The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
``__builtin_elementwise_sub_sat`` can be called in a ``constexpr`` context.

No implicit promotion of integer types takes place. The mixing of integer types
of different sizes and signs is forbidden in binary and ternary builtins.

============================================== ====================================================================== =========================================
Name Operation Supported element types
============================================== ====================================================================== =========================================
Expand Down
7 changes: 7 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ C++17 Feature Support
Resolutions to C++ Defect Reports
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- The flag `-frelaxed-template-template-args`
and its negation have been removed, having been deprecated since the previous
two releases. The improvements to template template parameter matching implemented
in the previous release, as described in P3310 and P3579, made this flag unnecessary.

C Language Changes
------------------

Expand Down Expand Up @@ -121,6 +126,8 @@ Bug Fixes to Attribute Support
Bug Fixes to C++ Support
^^^^^^^^^^^^^^^^^^^^^^^^

- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
15 changes: 11 additions & 4 deletions clang/include/clang/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,10 @@ class ValueDecl : public NamedDecl {
return const_cast<ValueDecl *>(this)->getPotentiallyDecomposedVarDecl();
}

/// Determine whether this value is actually a function parameter pack,
/// init-capture pack, or structured binding pack
bool isParameterPack() const;

// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K >= firstValue && K <= lastValue; }
Expand Down Expand Up @@ -1527,10 +1531,6 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
NonParmVarDeclBits.IsInitCapture = IC;
}

/// Determine whether this variable is actually a function parameter pack or
/// init-capture pack.
bool isParameterPack() const;

/// Whether this local extern variable declaration's previous declaration
/// was declared in the same block scope. Only correct in C++.
bool isPreviousDeclInSameBlockScope() const {
Expand Down Expand Up @@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl,
FunctionDeclBits.IsLateTemplateParsed = ILT;
}

bool isInstantiatedFromMemberTemplate() const {
return FunctionDeclBits.IsInstantiatedFromMemberTemplate;
}
void setInstantiatedFromMemberTemplate(bool Val = true) {
FunctionDeclBits.IsInstantiatedFromMemberTemplate = Val;
}

/// Whether this function is "trivial" in some specialized C++ senses.
/// Can only be true for default constructors, copy constructors,
/// copy assignment operators, and destructors. Not meaningful until
Expand Down
10 changes: 6 additions & 4 deletions clang/include/clang/AST/DeclBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,8 @@ class DeclContext {
uint64_t HasImplicitReturnZero : 1;
LLVM_PREFERRED_TYPE(bool)
uint64_t IsLateTemplateParsed : 1;
LLVM_PREFERRED_TYPE(bool)
uint64_t IsInstantiatedFromMemberTemplate : 1;

/// Kind of contexpr specifier as defined by ConstexprSpecKind.
LLVM_PREFERRED_TYPE(ConstexprSpecKind)
Expand Down Expand Up @@ -1827,7 +1829,7 @@ class DeclContext {
};

/// Number of inherited and non-inherited bits in FunctionDeclBitfields.
enum { NumFunctionDeclBits = NumDeclContextBits + 31 };
enum { NumFunctionDeclBits = NumDeclContextBits + 32 };

/// Stores the bits used by CXXConstructorDecl. If modified
/// NumCXXConstructorDeclBits and the accessor
Expand All @@ -1838,12 +1840,12 @@ class DeclContext {
LLVM_PREFERRED_TYPE(FunctionDeclBitfields)
uint64_t : NumFunctionDeclBits;

/// 20 bits to fit in the remaining available space.
/// 19 bits to fit in the remaining available space.
/// Note that this makes CXXConstructorDeclBitfields take
/// exactly 64 bits and thus the width of NumCtorInitializers
/// will need to be shrunk if some bit is added to NumDeclContextBitfields,
/// NumFunctionDeclBitfields or CXXConstructorDeclBitfields.
uint64_t NumCtorInitializers : 17;
uint64_t NumCtorInitializers : 16;
LLVM_PREFERRED_TYPE(bool)
uint64_t IsInheritingConstructor : 1;

Expand All @@ -1857,7 +1859,7 @@ class DeclContext {
};

/// Number of inherited and non-inherited bits in CXXConstructorDeclBitfields.
enum { NumCXXConstructorDeclBits = NumFunctionDeclBits + 20 };
enum { NumCXXConstructorDeclBits = NumFunctionDeclBits + 19 };

/// Stores the bits used by ObjCMethodDecl.
/// If modified NumObjCMethodDeclBits and the accessor
Expand Down
58 changes: 48 additions & 10 deletions clang/include/clang/AST/DeclCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -4175,31 +4175,32 @@ class BindingDecl : public ValueDecl {
/// binding).
Expr *Binding = nullptr;

BindingDecl(DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id)
: ValueDecl(Decl::Binding, DC, IdLoc, Id, QualType()) {}
BindingDecl(DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id,
QualType T)
: ValueDecl(Decl::Binding, DC, IdLoc, Id, T) {}

void anchor() override;

public:
friend class ASTDeclReader;

static BindingDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation IdLoc, IdentifierInfo *Id);
SourceLocation IdLoc, IdentifierInfo *Id,
QualType T);
static BindingDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);

/// Get the expression to which this declaration is bound. This may be null
/// in two different cases: while parsing the initializer for the
/// decomposition declaration, and when the initializer is type-dependent.
Expr *getBinding() const { return Binding; }

// Get the array of Exprs when the binding represents a pack.
llvm::ArrayRef<Expr *> getBindingPackExprs() const;

/// Get the decomposition declaration that this binding represents a
/// decomposition of.
ValueDecl *getDecomposedDecl() const { return Decomp; }

/// Get the variable (if any) that holds the value of evaluating the binding.
/// Only present for user-defined bindings for tuple-like types.
VarDecl *getHoldingVar() const;

/// Set the binding for this BindingDecl, along with its declared type (which
/// should be a possibly-cv-qualified form of the type of the binding, or a
/// reference to such a type).
Expand All @@ -4211,6 +4212,10 @@ class BindingDecl : public ValueDecl {
/// Set the decomposed variable for this BindingDecl.
void setDecomposedDecl(ValueDecl *Decomposed) { Decomp = Decomposed; }

/// Get the variable (if any) that holds the value of evaluating the binding.
/// Only present for user-defined bindings for tuple-like types.
VarDecl *getHoldingVar() const;

static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K == Decl::Binding; }
};
Expand Down Expand Up @@ -4238,8 +4243,16 @@ class DecompositionDecl final
NumBindings(Bindings.size()) {
std::uninitialized_copy(Bindings.begin(), Bindings.end(),
getTrailingObjects<BindingDecl *>());
for (auto *B : Bindings)
for (auto *B : Bindings) {
B->setDecomposedDecl(this);
if (B->isParameterPack() && B->getBinding()) {
for (Expr *E : B->getBindingPackExprs()) {
auto *DRE = cast<DeclRefExpr>(E);
auto *NestedB = cast<BindingDecl>(DRE->getDecl());
NestedB->setDecomposedDecl(this);
}
}
}
}

void anchor() override;
Expand All @@ -4257,8 +4270,33 @@ class DecompositionDecl final
static DecompositionDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID,
unsigned NumBindings);

ArrayRef<BindingDecl *> bindings() const {
return llvm::ArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
// Provide the range of bindings which may have a nested pack.
llvm::ArrayRef<BindingDecl *> bindings() const {
return {getTrailingObjects<BindingDecl *>(), NumBindings};
}

// Provide a flattened range to visit each binding.
auto flat_bindings() const {
llvm::ArrayRef<BindingDecl *> Bindings = bindings();
llvm::ArrayRef<Expr *> PackExprs;

// Split the bindings into subranges split by the pack.
auto S1 = Bindings.take_until(
[](BindingDecl *BD) { return BD->isParameterPack(); });

Bindings = Bindings.drop_front(S1.size());
if (!Bindings.empty()) {
PackExprs = Bindings.front()->getBindingPackExprs();
Bindings = Bindings.drop_front();
}

auto S2 = llvm::map_range(PackExprs, [](Expr *E) {
auto *DRE = cast<DeclRefExpr>(E);
return cast<BindingDecl>(DRE->getDecl());
});

return llvm::concat<BindingDecl *>(std::move(S1), std::move(S2),
std::move(Bindings));
}

void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override;
Expand Down
9 changes: 9 additions & 0 deletions clang/include/clang/AST/DeclTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,15 @@ class FunctionTemplateDecl : public RedeclarableTemplateDecl {
return getTemplatedDecl()->isThisDeclarationADefinition();
}

bool isCompatibleWithDefinition() const {
return getTemplatedDecl()->isInstantiatedFromMemberTemplate() ||
isThisDeclarationADefinition();
}
void setInstantiatedFromMemberTemplate(FunctionTemplateDecl *D) {
getTemplatedDecl()->setInstantiatedFromMemberTemplate();
RedeclarableTemplateDecl::setInstantiatedFromMemberTemplate(D);
}

/// Return the specialization with the provided arguments if it exists,
/// otherwise return the insertion point.
FunctionDecl *findSpecialization(ArrayRef<TemplateArgument> Args,
Expand Down
Loading