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]

c++/5387: g++ fails to catch use of private type in template



>Number:         5387
>Category:       c++
>Synopsis:       g++ fails to catch use of private type in template
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 15 05:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jason Merrill
>Release:        unknown-1.0
>Organization:
redhat
>Environment:
System: Linux prospero.cambridge.redhat.com 2.4.13-0.5 #1 Sat Nov 3 15:08:02 EST 2001 i686 unknown
Architecture: i686

	
>Description:
	In the testcase below, g++ fails to diagnose the use of B::X in the definition
of A<B>::x.
	
>How-To-Repeat:

  template <class T> struct A {
	  typename T::X x;
	  int f() { return T::i; }
  };

  class B {
	  typedef int X;
	  static int i;
  };

  int main()
  {
	  A<B> ab;
	  ab.f();
  }

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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