diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index 9809ccb2ccc00..484c02498f20b 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -1110,14 +1110,8 @@ NormalizedConstraint::fromConstraintExpr(Sema &S, NamedDecl *D, const Expr *E) { // C++2a [temp.param]p4: // [...] If T is not a pack, then E is E', otherwise E is (E' && ...). - // - // Using the pattern suffices because the partial ordering rules guarantee - // the template paramaters are equivalent. - if (auto *FoldE = dyn_cast(E)) { - assert(FoldE->isRightFold() && FoldE->getOperator() == BO_LAnd); - assert(E->IgnoreParenImpCasts() == E); - E = FoldE->getPattern(); - } + // Fold expression is considered atomic constraints per current wording. + // See http://cplusplus.github.io/concepts-ts/ts-active.html#28 if (LogicalBinOp BO = E) { auto LHS = fromConstraintExpr(S, D, BO.getLHS()); diff --git a/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.cpp b/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.cpp index bdd1c376243bb..d6e6d73d05ed5 100644 --- a/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.cpp @@ -44,23 +44,8 @@ template void foo(T, U); -// check auto template parameter pack. -template class U, - C auto... Z> -void foo2(T, U) = delete; -template class U, - D auto... Z> -void foo2(T, U) = delete; -template class U, - E auto... Z> -void foo2(T, U); - void bar(S s, S2 s2) { foo(0, s); - foo2(0, s2); } template void bar2(); @@ -110,8 +95,9 @@ template struct Y4; // expected-error {{class template partial s template struct W1; template struct W1 {}; -template struct W2; -template struct W2 {}; +// See http://cplusplus.github.io/concepts-ts/ts-active.html#28 +// template struct W2; +// template struct W2 {}; template concept C1 = C && C; @@ -121,8 +107,9 @@ concept D1 = D && C; template auto T> struct W3; template auto T> struct W3 {}; -template auto... T> struct W4; -template auto... T> struct W4 {}; +// See http://cplusplus.github.io/concepts-ts/ts-active.html#28 +// template auto... T> struct W4; +// template auto... T> struct W4 {}; // FIXME: enable once Clang support non-trivial auto on NTTP. // template struct W5; @@ -133,9 +120,9 @@ template auto... T> struct W4 {}; // template struct W6 {}; struct W1<0> w1; -struct W2<0> w2; +// struct W2<0> w2; struct W3<0> w3; -struct W4<0> w4; +// struct W4<0> w4; // FIXME: enable once Clang support non-trivial auto on NTTP. // struct W5<(int*)nullptr> w5; // struct W6 w6;