diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2018-11-12 21:31:06 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2018-11-12 21:31:06 +0000 |
commit | f78993129b8de5baafb0d90aa59747d480be915d (patch) | |
tree | a4798fcd79d53c55b04b37b4b93e691d82eedd51 | |
parent | 01bad5891ee5124df4c21328f75bf22c6e0228bd (diff) |
[Sema] Make sure we substitute an instantiation-dependent default template argument
Fixes llvm.org/PR39623
Differential revision: https://reviews.llvm.org/D54414
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346709 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/alias-template.cpp | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index fb792b7539..a4da62b6cb 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -4434,7 +4434,7 @@ SubstDefaultTemplateArgument(Sema &SemaRef, // If the argument type is dependent, instantiate it now based // on the previously-computed template arguments. - if (ArgType->getType()->isDependentType()) { + if (ArgType->getType()->isInstantiationDependentType()) { Sema::InstantiatingTemplate Inst(SemaRef, TemplateLoc, Param, Template, Converted, SourceRange(TemplateLoc, RAngleLoc)); diff --git a/test/SemaCXX/alias-template.cpp b/test/SemaCXX/alias-template.cpp index b6256103ef..f2ba04df78 100644 --- a/test/SemaCXX/alias-template.cpp +++ b/test/SemaCXX/alias-template.cpp @@ -179,3 +179,13 @@ struct S { }; static_assert(__is_same(S<3>::U, X[2]), ""); // expected-error {{static_assert failed}} } + +namespace PR39623 { +template <class T> +using void_t = void; + +template <class T, class = void_t<typename T::wait_what>> +int sfinae_me() { return 0; } // expected-note{{candidate template ignored: substitution failure}} + +int g = sfinae_me<int>(); // expected-error{{no matching function for call to 'sfinae_me'}} +} |