summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-06 06:44:44 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-06 06:44:44 +0000
commit16b65394ee3ee612b9a16855d5511630cb3baf1c (patch)
tree641f62d431e03c659181698d5aede9361161ea60 /clang/test
parent1e3d3874596d6627175b952091f75429d761d673 (diff)
downloadbcm5719-llvm-16b65394ee3ee612b9a16855d5511630cb3baf1c.tar.gz
bcm5719-llvm-16b65394ee3ee612b9a16855d5511630cb3baf1c.zip
Fix http://stackoverflow.com/questions/13521163
Don't require that, during template deduction, a template specialization type as a function parameter has at least as many template arguments as one used in a function argument (not even if the argument has been resolved to an exact type); the additional parameters might be provided by default template arguments in the template. We don't need this check, since we now implement [temp.deduct.call]p4 with an additional check after deduction. llvm-svn: 169475
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp b/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
index 7774b5c77fa..d7989e305f0 100644
--- a/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
+++ b/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
@@ -53,3 +53,16 @@ namespace DeduceNonTypeTemplateArgsInArray {
tuple<unsigned_c<1>, unsigned_c<2>, unsigned_c<3>>
>::value? 1 : -1];
}
+
+namespace DeduceWithDefaultArgs {
+ template<template<typename...> class Container> void f(Container<int>); // expected-note {{substitution failure [with Container = X]}}
+ template<typename, typename = int> struct X {};
+ void g() {
+ // OK, use default argument for the second template parameter.
+ f(X<int>{});
+ f(X<int, int>{});
+
+ // Not OK.
+ f(X<int, double>{}); // expected-error {{no matching function for call to 'f'}}
+ }
+}
OpenPOWER on IntegriCloud