summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2020-02-06 23:19:18 +0200
committerSaar Raz <saar@raz.email>2020-02-06 23:30:34 +0200
commit96ed02ddeebfd18265ef687fce80e7e148ec261c (patch)
tree70606c7b9906f51d377ecfd04ee05ca0243c9014 /clang/test/SemaTemplate
parentc0c5ab30179897944cf44efac1c743e5344924db (diff)
downloadbcm5719-llvm-96ed02ddeebfd18265ef687fce80e7e148ec261c.tar.gz
bcm5719-llvm-96ed02ddeebfd18265ef687fce80e7e148ec261c.zip
[Concepts] Fix incorrect check when instantiating abbreviated template type-constraints
We would incorrectly check whether the type-constraint had already been initialized, causing us to ignore the invented template type constraints entirely. Also, TemplateParameterList would store incorrect information about invented type parameters when it observed them before their type-constraint was initialized, so we recreate it after initializing the function type of an abbreviated template. (cherry picked from commit 38fd69995fc5a6f16e0aa132a46e5ccdbc2eebb3)
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r--clang/test/SemaTemplate/instantiate-abbreviated-template.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp b/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp
index a73b6ce3610..99801115626 100644
--- a/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp
+++ b/clang/test/SemaTemplate/instantiate-abbreviated-template.cpp
@@ -1,29 +1,33 @@
// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
-// expected-no-diagnostics
template<typename...>
-concept C = true;
+concept C = false; // expected-note 9{{because}}
template<typename T>
struct S {
template<typename U>
static void foo1(U a, auto b);
static void foo2(T a, C<T> auto b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
static void foo3(T a, C<decltype(a)> auto b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
static void foo4(T a, C<decltype(a)> auto b, const C<decltype(b)> auto &&c);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}}
};
using sf1 = decltype(S<int>::foo1(1, 2));
-using sf2 = decltype(S<int>::foo2(1, 2));
-using sf3 = decltype(S<int>::foo3(1, 2));
-using sf4 = decltype(S<int>::foo4(1, 2, 3));
+using sf2 = decltype(S<int>::foo2(1, 2)); // expected-error{{no matching function}}
+using sf3 = decltype(S<int>::foo3(1, 2)); // expected-error{{no matching function}}
+using sf4 = decltype(S<int>::foo4(1, 2, 3)); // expected-error{{no matching function}}
template<typename... T>
struct G {
static void foo1(auto a, const C<decltype(a)> auto &&... b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}} expected-note@-1 3{{and}}
static void foo2(auto a, const C<decltype(a), T> auto &&... b);
+ // expected-note@-1{{candidate template ignored}} expected-note@-1{{because}} expected-note@-1{{and}}
};
-using gf1 = decltype(G<int, char>::foo1('a', 1, 2, 3, 4));
-using gf2 = decltype(G<int, char>::foo2('a', 1, 2));
+using gf1 = decltype(G<int, char>::foo1('a', 1, 2, 3, 4)); // expected-error{{no matching function}}
+using gf2 = decltype(G<int, char>::foo2('a', 1, 2)); // expected-error{{no matching function}}
OpenPOWER on IntegriCloud