public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18304] New: unnecessary typename expected
@ 2004-11-04 22:40 boris at kolpackov dot net
  2004-11-04 22:55 ` [Bug c++/18304] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: boris at kolpackov dot net @ 2004-11-04 22:40 UTC (permalink / raw)
  To: gcc-bugs

$ cat >test.cxx
template <typename x>
struct s
{
  struct t
  {
    enum v { a, b };
  };
  
  t::v m_;
};


$ g++ -v
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ./configure --enable-languages=c,c++ --enable-shared
--with-system-zlib --enable-nls --program-suffix=-3.4 --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --enable-clocale=gnu --enable-libstdcxx-debug
--disable-werror
Thread model: posix
gcc version 3.4.3 20041101 (prerelease)

$ g++ -c test.cxx
test.cxx:9: error: expected `;' before "m_

-- 
           Summary: unnecessary typename expected
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boris at kolpackov dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


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


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

* [Bug c++/18304] unnecessary typename expected
  2004-11-04 22:40 [Bug c++/18304] New: unnecessary typename expected boris at kolpackov dot net
@ 2004-11-04 22:55 ` pinskia at gcc dot gnu dot org
  2004-11-05  0:35 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-04 22:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-04 22:55 -------
This is a dup of bug 9634.

*** This bug has been marked as a duplicate of 9634 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c++/18304] unnecessary typename expected
  2004-11-04 22:40 [Bug c++/18304] New: unnecessary typename expected boris at kolpackov dot net
  2004-11-04 22:55 ` [Bug c++/18304] " pinskia at gcc dot gnu dot org
@ 2004-11-05  0:35 ` giovannibajo at libero dot it
  2004-11-05  0:39 ` giovannibajo at libero dot it
  2004-11-05 10:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-05  0:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-05 00:35 -------
No, DR 224 will disambiguate whether the injected class name is dependent or 
not. This is unrelated. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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

* [Bug c++/18304] unnecessary typename expected
  2004-11-04 22:40 [Bug c++/18304] New: unnecessary typename expected boris at kolpackov dot net
  2004-11-04 22:55 ` [Bug c++/18304] " pinskia at gcc dot gnu dot org
  2004-11-05  0:35 ` giovannibajo at libero dot it
@ 2004-11-05  0:39 ` giovannibajo at libero dot it
  2004-11-05 10:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-05  0:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-05 00:39 -------
Anyway, it is invalid because a nested class (like "t") is always dependent, as 
you can specialize it. think of what happens if you define this later:

template <>
struct s<void>::t {
};

(now, in this very case, it would be invalid because you cannot specialize this 
nested class after having already used the primary template s<x>::t, but the 
point is to show that s<x>::t is always a dependent context, even within s<x>).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug c++/18304] unnecessary typename expected
  2004-11-04 22:40 [Bug c++/18304] New: unnecessary typename expected boris at kolpackov dot net
                   ` (2 preceding siblings ...)
  2004-11-05  0:39 ` giovannibajo at libero dot it
@ 2004-11-05 10:29 ` reichelt at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-05 10:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-05 10:29 -------
For those in doubt, here's chapter and verse: [14.6]/6 says

  Within the definition of a class template [...] the keyword typename is
  not required when referring to the unqualified name of a previously
  declared member of the class template that declares a type. The keyword
  typename shall always be specified when the member is referred to using
  a qualified name [...].

Since t::v is a qualified name I agree with Giovanni and GCC.
Btw, icc seems to get it wrong.


-- 


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


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

end of thread, other threads:[~2004-11-05 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-04 22:40 [Bug c++/18304] New: unnecessary typename expected boris at kolpackov dot net
2004-11-04 22:55 ` [Bug c++/18304] " pinskia at gcc dot gnu dot org
2004-11-05  0:35 ` giovannibajo at libero dot it
2004-11-05  0:39 ` giovannibajo at libero dot it
2004-11-05 10:29 ` reichelt 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).