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++/12823] New: Cannot call member function template of nested class inside 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=12823

           Summary: Cannot call member function template of nested class
                    inside template class
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bsamwel at xs4all dot nl
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu

AFAICS the following code should compile.


template<int a>
struct foo
{
  struct barney
  {
    template<int c>
    void bar()
    {  
    }
  };

  void baz()
  {
    barney b;
    b.bar<0>(); // (This is line 15.)
  }
};

Comeau's online compiler compiles this snippet just fine. GCC 3.3.2 gives me:

gcc test.cc
test.cc: In member function `void foo<a>::baz()':
test.cc:15: error: parse error before `;' token


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