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++/3825: Problems in instantiation of generic members.


I believe the code given is substantially wrong.   Consider, however, the 
following testcase:
---
template< typename X, typename Y, int = 1 >
 struct C1 {
  template< int, int >
   struct C2 {
     enum { v = 0 };
   };
};

enum Xx { a, b, c, d };

template <> template <>
 struct C1< Xx, Xx >::C2< a, a > {
   enum { v = 1 };
 };

template< typename X >
 struct D: public C1< X, X, 5 > {
  template< int, int > struct C2 {
     enum { v = 2 };
   };

#include <iostream>
 int main() {
   std::cout << D< Xx >::C2< a, a >::v << std::endl;
// And the next case...
   std::cout << C1< Xx, Xx >::C2< a, a >::v << std::endl;
 }
---

This compiles perfectly and gives correct results.

So I'm guessing this can be closed...

Do I need to add a testcase for this, or are there enough already?


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