summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_template.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-09 23:54:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-09 23:54:33 +0000
commitb62544540682e5e9418ba65b69c081d6c029cd43 (patch)
tree244a95db294d36963eb57a217503e927bdba85e8 /test/SemaTemplate/temp_arg_template.cpp
parente0078e5ad7b5e75cd2039496b5307698571cf56a (diff)
downloadclang-b62544540682e5e9418ba65b69c081d6c029cd43.tar.gz
Check that template template arguments match template template parameters
properly even when a non-type template parameter has a dependent type. Previously, if a non-type template parameter was dependent, but not dependent on an outer level of template parameter, we would not match the type of the parameter. Under [temp.arg.template], we are supposed to check that the types are equivalent, which means checking for syntactic equivalence in the dependent case. This also fixes some accepts-invalids when passing templates with auto-typed non-type template parameters as template template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_arg_template.cpp')
-rw-r--r--test/SemaTemplate/temp_arg_template.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_template.cpp b/test/SemaTemplate/temp_arg_template.cpp
index 67cde53c92..b0df9149c6 100644
--- a/test/SemaTemplate/temp_arg_template.cpp
+++ b/test/SemaTemplate/temp_arg_template.cpp
@@ -100,3 +100,9 @@ struct S : public template_tuple<identity, identity> {
void foo() {
f7<identity>();
}
+
+namespace CheckDependentNonTypeParamTypes {
+ template<template<typename T, typename U, T v> class> struct A {}; // expected-note {{previous}}
+ template<typename T, typename U, U v> struct B {}; // expected-note {{different type}}
+ A<B> ab; // expected-error {{different template parameters}}
+}