diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-09 23:54:33 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-09 23:54:33 +0000 |
commit | 43a833bec47b9eb43cd57ef61256b1a287ee32c2 (patch) | |
tree | 98ca41fe25fe34e787ff293b73825156f12a16d8 /clang/test/SemaTemplate/temp_arg_template.cpp | |
parent | 0e93c3932a85fc74abbcb0f2df8c048fed5a1f0d (diff) | |
download | bcm5719-llvm-43a833bec47b9eb43cd57ef61256b1a287ee32c2.tar.gz bcm5719-llvm-43a833bec47b9eb43cd57ef61256b1a287ee32c2.zip |
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.
llvm-svn: 291512
Diffstat (limited to 'clang/test/SemaTemplate/temp_arg_template.cpp')
-rw-r--r-- | clang/test/SemaTemplate/temp_arg_template.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_template.cpp b/clang/test/SemaTemplate/temp_arg_template.cpp index 67cde53c928..b0df9149c6e 100644 --- a/clang/test/SemaTemplate/temp_arg_template.cpp +++ b/clang/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}} +} |