diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-26 02:11:23 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-26 02:11:23 +0000 |
commit | 59d0500bd0586f0829111ca1b4030b986f21d2ec (patch) | |
tree | 03ae993c61939171e85982173d662c278f16233f /clang/test/SemaTemplate/explicit-specialization-member.cpp | |
parent | 2db79e9d2cacc7a387d3e1e6bf0f6ac0a7d5d292 (diff) | |
download | bcm5719-llvm-59d0500bd0586f0829111ca1b4030b986f21d2ec.tar.gz bcm5719-llvm-59d0500bd0586f0829111ca1b4030b986f21d2ec.zip |
PR41607: Don't forget to substitute outer template arguments into a
class-scope explicit specialization of a class template.
llvm-svn: 359266
Diffstat (limited to 'clang/test/SemaTemplate/explicit-specialization-member.cpp')
-rw-r--r-- | clang/test/SemaTemplate/explicit-specialization-member.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/explicit-specialization-member.cpp b/clang/test/SemaTemplate/explicit-specialization-member.cpp index e8165ac9ca7..e84364a5086 100644 --- a/clang/test/SemaTemplate/explicit-specialization-member.cpp +++ b/clang/test/SemaTemplate/explicit-specialization-member.cpp @@ -62,3 +62,20 @@ namespace SpecLoc { template<> float A<int>::n; // expected-error {{different type}} template<> void A<int>::f() throw(); // expected-error {{does not match}} } + +namespace PR41607 { + template<int N> struct Outer { + template<typename...> struct Inner; + template<> struct Inner<> { + static constexpr int f() { return N; } + }; + + template<typename...> static int a; // expected-note 2{{}} + template<> static constexpr int a<> = 42; + }; + static_assert(Outer<123>::Inner<>::f() == 123, ""); + static_assert(Outer<123>::Inner<>::f() != 125, ""); + // FIXME: The class-scope explicit specialization of the variable template doesn't work! + static_assert(Outer<123>::a<> == 42, ""); // expected-error {{}} expected-note {{}} + static_assert(Outer<123>::a<> != 43, ""); // expected-error {{}} expected-note {{}} +} |