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++/25868] New: Multiple templates and typedefs cause function prototype not to match


I have one template class munge_type which takes a type and has a typedef in
it, new_type.  Another template class has another typedef in it, inner_type,
and a method that returns munge_type<inner_type>::new_type.  If I define the
method outside the class, I get these errors:

gtp8.cpp:17: error: prototype for `typename munge_type<typename
some_class<type>::inner_type>::new_type some_class<type>::method()' does not
match any in class `some_class<type>'
gtp8.cpp:11: error: candidate is: int some_class<type>::method()
gtp8.cpp:17: error: template definition of non-template `typename
munge_type<typename some_class<type>::inner_type>::new_type
some_class<type>::method()'

I'll attach the file that gives these errors.  Tested on gentoo with gcc 3.4.4
and gcc 4.0.2 (which both exhibit the problem) and 3.3.6 (which does not give
an error).


-- 
           Summary: Multiple templates and typedefs cause function prototype
                    not to match
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: 1l8p4ex95x5001 at sneakemail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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