diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-08 02:04:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-08 02:04:14 +0000 |
commit | db93fdee6c5a24e86ee5ed8c1d3b597e17d5893b (patch) | |
tree | b89c381940c443374d93b350ce2b3975fb410367 /test | |
parent | e224ba7e3e604113aa160c379293bcb6425e8f36 (diff) |
Detect attempts to provide a specialization of a function within a
dependent scope and produce an error (rather than crashing). Fixes PR8979.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp index 1032a87def..2295235570 100644 --- a/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp +++ b/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp @@ -237,3 +237,15 @@ void test_func_template(N0::X0<void *> xvp, void *vp, const void *cvp, xvp.ft1(vp, i); xvp.ft1(vp, u); } + +namespace PR8979 { + template<typename Z> + struct X0 { + template <class T, class U> class Inner; + struct OtherInner; + template<typename T, typename U> void f(Inner<T, U>&); + + typedef Inner<OtherInner, OtherInner> MyInner; + template<> void f(MyInner&); // expected-error{{cannot specialize a function 'f' within class scope}} + }; +} |