This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7308: template specialization in other namespace
- From: bangerth at dealii dot org
- To: a9804814 at unet dot univie dot ac dot at, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 20 Dec 2002 02:38:35 -0000
- Subject: Re: c++/7308: template specialization in other namespace
- Reply-to: bangerth at dealii dot org, a9804814 at unet dot univie dot ac dot at, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: template-class member functions / namespace scope resolution in conjunction with template specialization
New Synopsis: template specialization in other namespace
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Dec 19 18:38:35 2002
State-Changed-Why:
Problem 1 you describe is a well-known bug, namely that
gcc does not presently implement two-stage name lookup.
Problem 2 can be reduced to the following illegal code that
gcc nevertheless compiles:
----------------------------
namespace NS_1 {
namespace NS_2 {
template <typename T> struct C {
void foo ();
};
}
template <>
void NS_2::C<int>::foo() {}
}
int main() {
NS_1::NS_2::C<int> c;
}
-------------------------
Specializations shall be _declared_ in the same namespace
in which the general template is declared, if I understand
correctly, i.e. there is at least a declaration in the inner
namespace missing.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7308