This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7308: template specialization in other namespace


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]