diff options
author | simartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-02 05:37:17 +0000 |
---|---|---|
committer | simartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-02 05:37:17 +0000 |
commit | d347f7460ffc9f0a934580e98e763f2534a503e6 (patch) | |
tree | 40fc3d7d72f3e83c6a2b8bcd70ba2bab8491015c /gcc/testsuite/g++.dg | |
parent | c42a600330dd20ec63eebb33aa3b0fe4eff109db (diff) | |
download | gcc-d347f7460ffc9f0a934580e98e763f2534a503e6.tar.gz |
gcc/cp/
2009-06-02 Simon Martin <simartin@users.sourceforge.net>
PR c++/38089
* pt.c (register_specialization): Properly setup DECL_CONTEXT for
specializations in an invalid namespace.
gcc/testsuite/
2009-06-02 Simon Martin <simartin@users.sourceforge.net>
PR c++/38089
* g++.dg/template/spec36.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/template/spec36.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/spec36.C b/gcc/testsuite/g++.dg/template/spec36.C new file mode 100644 index 00000000000..71ff3a5c545 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/spec36.C @@ -0,0 +1,16 @@ +/* PR c++/38089 */ +/* { dg-do "compile" } */ + +struct basic_string +{ + basic_string(const int __s); +}; +namespace MyNS { + class MyClass { + template <typename T> + T test() { } /* { dg-error "from definition" } */ + }; +} +template <> +basic_string MyNS::MyClass::test() /* { dg-error "specialization of" } */ +{ return 1; } |