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]

[Bug c++/11562] New: Reject legal code : call of template function in a template class


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11562

           Summary: Reject legal code : call of template function in a
                    template class
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: have at ann dot jussieu dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: gcc version 3.3.1 20030626
  GCC host triplet: Linux-2.4.20 i686

Compiling this piece of code generates a parse error: 
test.cpp: In member function `void B<T>::f()': 
test.cpp:9: error: syntax error before `;' token 
 
Tested with g++ 2.95.4, 3.0.4, 3.2.3, 3.3.1 
 
Removing 'template<typename T>' does not generate any error. 
 
----%<--------------------------------------- 
struct A { 
  template<typename U> void head() { } 
}; 
 
template<typename T> 
struct B { 
  void f() { 
    A a; 
    a.head<int>(); 
  } 
}; 
 
int main() { }


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