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++/34810] accepts invalid dependent(?) type in template class method



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-01-16 13:26 -------
EDG rejects this with

t.C(6): error: class template "Foo<T>" has no member "Foo"
      typename Foo<T>::Foo ();
                       ^

G++ accepts this even if you instantiate Foo.  G++ also accepts

template <typename T>
struct Foo
{
  void bar ()
  {
    typename Foo<T>::Foox ();
  }
};

but rejects that once you instantiate Foo.

template struct Foo<int>;

It looks like EDG does not treat Foo<T>::Fox as dependent?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-16 13:26:36
               date|                            |
            Summary|G++ accepts wrong code      |accepts invalid dependent(?)
                   |                            |type in template class
                   |                            |method


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


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