[PATCH] D54414: [Sema] Make sure we substitute an instantiation-dependent default template parameter
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 12 13:33:42 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346709: [Sema] Make sure we substitute an instantiation-dependent default template… (authored by epilk, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D54414?vs=173615&id=173752#toc
Repository:
rL LLVM
https://reviews.llvm.org/D54414
Files:
cfe/trunk/lib/Sema/SemaTemplate.cpp
cfe/trunk/test/SemaCXX/alias-template.cpp
Index: cfe/trunk/test/SemaCXX/alias-template.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/alias-template.cpp
+++ cfe/trunk/test/SemaCXX/alias-template.cpp
@@ -179,3 +179,13 @@
};
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'}}
+}
Index: cfe/trunk/lib/Sema/SemaTemplate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp
@@ -4434,7 +4434,7 @@
// 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));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54414.173752.patch
Type: text/x-patch
Size: 1295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181112/5bfc3714/attachment.bin>
More information about the cfe-commits
mailing list