public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34810]  New: G++ accepts wrong code
@ 2008-01-16 12:27 v dot haisman at sh dot cvut dot cz
  2008-01-16 13:33 ` [Bug c++/34810] accepts invalid dependent(?) type in template class method rguenth at gcc dot gnu dot org
  2008-01-16 15:25 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2008-01-16 12:27 UTC (permalink / raw)
  To: gcc-bugs

Hi,
G++ (gcc version 4.3.0 20080104 (experimental) (GCC)) accepts the following
code that Comeau rejects:

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


-- 
           Summary: G++ accepts wrong code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
 GCC build triplet: i386-portbld-freebsd6.2
  GCC host triplet: i386-portbld-freebsd6.2
GCC target triplet: i386-portbld-freebsd6.2


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/34810] accepts invalid dependent(?) type in template class method
  2008-01-16 12:27 [Bug c++/34810] New: G++ accepts wrong code v dot haisman at sh dot cvut dot cz
@ 2008-01-16 13:33 ` rguenth at gcc dot gnu dot org
  2008-01-16 15:25 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-16 13:33 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/34810] accepts invalid dependent(?) type in template class method
  2008-01-16 12:27 [Bug c++/34810] New: G++ accepts wrong code v dot haisman at sh dot cvut dot cz
  2008-01-16 13:33 ` [Bug c++/34810] accepts invalid dependent(?) type in template class method rguenth at gcc dot gnu dot org
@ 2008-01-16 15:25 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-16 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-01-16 14:53 -------
There is a defect report about what is a dependent name.  The DR causes some
things to be non dependent and not which were in the original standard and is
weird as it turns somestuff which really should be dependent into non
dependent.  I forgot the DR number.


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-16 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-16 12:27 [Bug c++/34810] New: G++ accepts wrong code v dot haisman at sh dot cvut dot cz
2008-01-16 13:33 ` [Bug c++/34810] accepts invalid dependent(?) type in template class method rguenth at gcc dot gnu dot org
2008-01-16 15:25 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).