summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-01-04 01:24:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-01-04 01:24:17 +0000
commit1337318eea74661a993023f657e4d15da8463945 (patch)
tree8ff00b6f20fb9b3167e7cb00e69413975cce268c /clang/lib
parent8fbad0a4c208f4d30ae6274e1c9f663b143f46be (diff)
downloadbcm5719-llvm-1337318eea74661a993023f657e4d15da8463945.tar.gz
bcm5719-llvm-1337318eea74661a993023f657e4d15da8463945.zip
PR35045: Convert injected-class-name to its corresponding simple-template-id
during template argument deduction. We already did this when the injected-class-name was in P, but missed the case where it was in A. This (probably) can't happen except in implicit deduction guides. llvm-svn: 321779
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 3a0f2ff0004..d09cf9933ec 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -502,6 +502,10 @@ DeduceTemplateArguments(Sema &S,
SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
assert(Arg.isCanonical() && "Argument type must be canonical");
+ // Treat an injected-class-name as its underlying template-id.
+ if (auto *Injected = dyn_cast<InjectedClassNameType>(Arg))
+ Arg = Injected->getInjectedSpecializationType();
+
// Check whether the template argument is a dependent template-id.
if (const TemplateSpecializationType *SpecArg
= dyn_cast<TemplateSpecializationType>(Arg)) {
OpenPOWER on IntegriCloud