Skip to content

Commit ebe396b

Browse files
committed
pack tests, remove dead code
1 parent a1eb5b5 commit ebe396b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12779,7 +12779,7 @@ class Sema final : public SemaBase {
1277912779
/// Mark which template parameters are named in a given expression.
1278012780
///
1278112781
/// Unlike MarkUsedTemplateParameters, this excludes parameter that
12782-
/// are used but not directly named by an expression - ie it excludes
12782+
/// are used but not directly named by an expression - i.e. it excludes
1278312783
/// any template parameter that denotes the type of a referenced NTTP.
1278412784
///
1278512785
/// \param Used a bit vector whose elements will be set to \c true

clang/lib/Sema/SemaConcept.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,10 +1937,6 @@ void SubstituteParameterMappings::buildParameterMapping(
19371937
static_cast<FoldExpandedConstraint &>(N).getPattern(),
19381938
/*OnlyDeduced=*/false,
19391939
/*Depth=*/0, OccurringIndices);
1940-
1941-
SemaRef.MarkUsedTemplateParametersForSubsumptionParameterMapping(
1942-
static_cast<FoldExpandedConstraint &>(N).getPattern(),
1943-
/*Depth=*/0, OccurringIndicesForSubsumption);
19441940
}
19451941
TemplateArgumentLoc *TempArgs =
19461942
new (SemaRef.Context) TemplateArgumentLoc[OccurringIndices.count()];

clang/test/SemaTemplate/instantiate-template-argument.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ static_assert(foo<int, 'a'>() == 2);
5757

5858
}
5959

60+
namespace packs {
61+
62+
template<auto T, decltype(T)... U>
63+
concept C1 = (sizeof(U) && ...) >= 4;
64+
65+
template<typename Y, char... V>
66+
concept C2 = (C1<Y{}, V> && ...);
67+
68+
template<char... W>
69+
constexpr int foo() requires (C2<int, W> && ...) { return 1; }
70+
71+
template<char... X>
72+
constexpr int foo() requires (C1<1, X> && ...) && true { return 2; }
73+
74+
static_assert(foo<'a'>() == 2);
75+
76+
}
77+
6078
namespace case2 {
6179
template<auto T> concept C1 = sizeof(decltype(T)) >= 0;
6280
template<typename Y> concept C2 = C1<Y{}>;

0 commit comments

Comments
 (0)