summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-12-30 20:56:05 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-12-30 20:56:05 +0000
commit50d5b97449c92a8395c57aa6df39e593a123a6bc (patch)
tree07d2600d15af9fcb032c2abdad16f8ad919940a8 /clang/lib/Sema
parentce9ef39c10428264bd54482831eb9dd4c5fa28f2 (diff)
downloadbcm5719-llvm-50d5b97449c92a8395c57aa6df39e593a123a6bc.tar.gz
bcm5719-llvm-50d5b97449c92a8395c57aa6df39e593a123a6bc.zip
Implement [temp.deduct.type]p6: if the nested-name-specifier of a type is
dependent, the type is a non-deduced context. llvm-svn: 256651
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index de04c8a7f04..837e0de4038 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -4887,19 +4887,23 @@ MarkUsedTemplateParameters(ASTContext &Ctx, QualType T,
break;
case Type::DependentTemplateSpecialization: {
+ // C++14 [temp.deduct.type]p5:
+ // The non-deduced contexts are:
+ // -- The nested-name-specifier of a type that was specified using a
+ // qualified-id
+ //
+ // C++14 [temp.deduct.type]p6:
+ // When a type name is specified in a way that includes a non-deduced
+ // context, all of the types that comprise that type name are also
+ // non-deduced.
+ if (OnlyDeduced)
+ break;
+
const DependentTemplateSpecializationType *Spec
= cast<DependentTemplateSpecializationType>(T);
- if (!OnlyDeduced)
- MarkUsedTemplateParameters(Ctx, Spec->getQualifier(),
- OnlyDeduced, Depth, Used);
- // C++0x [temp.deduct.type]p9:
- // If the template argument list of P contains a pack expansion that is not
- // the last template argument, the entire template argument list is a
- // non-deduced context.
- if (OnlyDeduced &&
- hasPackExpansionBeforeEnd(Spec->getArgs(), Spec->getNumArgs()))
- break;
+ MarkUsedTemplateParameters(Ctx, Spec->getQualifier(),
+ OnlyDeduced, Depth, Used);
for (unsigned I = 0, N = Spec->getNumArgs(); I != N; ++I)
MarkUsedTemplateParameters(Ctx, Spec->getArg(I), OnlyDeduced, Depth,
OpenPOWER on IntegriCloud