public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21783] New: No typedef required when type use in a function
@ 2005-05-27 14:40 florent dot gallet at orange dot fr
  2005-05-27 14:42 ` [Bug c++/21783] No typename " florent dot gallet at orange dot fr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 14:40 UTC (permalink / raw)
  To: gcc-bugs

template<class T> struct A {
  typedef int B;
  void f(typename A::B);    // illformed: typename required before A::B 
  A::B b;          // ok error detected
};

It's in the DRAFT: 25 November 1997
14.6 Name resolution

I don't know if that changed.
If someone could confirm.

-- 
           Summary: No typedef required when type use in a function
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: florent dot gallet at orange dot fr
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
@ 2005-05-27 14:42 ` florent dot gallet at orange dot fr
  2005-05-27 14:43 ` florent dot gallet at orange dot fr
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 14:42 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|No typedef required when    |No typename required when
                   |type use in a function      |type use in a function


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
  2005-05-27 14:42 ` [Bug c++/21783] No typename " florent dot gallet at orange dot fr
@ 2005-05-27 14:43 ` florent dot gallet at orange dot fr
  2005-05-27 14:48 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 14:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From florent dot gallet at orange dot fr  2005-05-27 14:42 -------
It's that, that shouldn't work :
   void f(A::B);    // illformed: typename required before A::B 


-- 


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
  2005-05-27 14:42 ` [Bug c++/21783] No typename " florent dot gallet at orange dot fr
  2005-05-27 14:43 ` florent dot gallet at orange dot fr
@ 2005-05-27 14:48 ` pinskia at gcc dot gnu dot org
  2005-05-27 15:02 ` florent dot gallet at orange dot fr
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-27 14:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-27 14:48 -------
This is weird because both ICC and Comeau accept this too (even in strict mode).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (2 preceding siblings ...)
  2005-05-27 14:48 ` pinskia at gcc dot gnu dot org
@ 2005-05-27 15:02 ` florent dot gallet at orange dot fr
  2005-05-27 15:25 ` florent dot gallet at orange dot fr
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 15:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From florent dot gallet at orange dot fr  2005-05-27 15:01 -------
I only have the DRAFT, so I don't know if it's really a bug.

-- 


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (3 preceding siblings ...)
  2005-05-27 15:02 ` florent dot gallet at orange dot fr
@ 2005-05-27 15:25 ` florent dot gallet at orange dot fr
  2005-05-27 15:50 ` florent dot gallet at orange dot fr
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 15:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From florent dot gallet at orange dot fr  2005-05-27 15:23 -------
Tested with VC++ 2003:
SansNom1.cpp(7) : warning C4346: 'A<T>::B' : dependent name is not a type
        prefix with 'typename' to indicate a type
        SansNom1.cpp(9) : see reference to class template instantiation 'A<T>' 
being compiled
SansNom1.cpp(7) : error C2061: syntax error : identifier 'B'

Code used:
7.  template<class T> struct A {
8.    typedef int B;
9.    void f(A::B);    // illformed: typename required before A::B 
10. //  A::B b;          // ok error detected
11. };

-- 


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (4 preceding siblings ...)
  2005-05-27 15:25 ` florent dot gallet at orange dot fr
@ 2005-05-27 15:50 ` florent dot gallet at orange dot fr
  2005-06-07 17:07 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: florent dot gallet at orange dot fr @ 2005-05-27 15:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From florent dot gallet at orange dot fr  2005-05-27 15:25 -------
(sorry, the line number are wrong, begin at 5)

-- 


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (5 preceding siblings ...)
  2005-05-27 15:50 ` florent dot gallet at orange dot fr
@ 2005-06-07 17:07 ` reichelt at gcc dot gnu dot org
  2005-06-07 18:45 ` giovannibajo at libero dot it
  2005-06-07 19:07 ` [Bug c++/21783] [DR 409] Typename for required for qualified name? reichelt at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-06-07 17:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-06-07 17:07 -------
Confirmed.

It's in the standard from 1998: [14.6]/6


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |monitored
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-07 17:07:32
               date|                            |


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


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

* [Bug c++/21783] No typename required when type use in a function
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (6 preceding siblings ...)
  2005-06-07 17:07 ` reichelt at gcc dot gnu dot org
@ 2005-06-07 18:45 ` giovannibajo at libero dot it
  2005-06-07 19:07 ` [Bug c++/21783] [DR 409] Typename for required for qualified name? reichelt at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: giovannibajo at libero dot it @ 2005-06-07 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-06-07 18:45 -------
There is a DR and surely another bug report about this. It's uncertain whether 
typename is needed to disambiguate a qualified name where the scope is the 
injected class name (which always refers to the current instantiation).

-- 


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


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

* [Bug c++/21783] [DR 409] Typename for required for qualified name?
  2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
                   ` (7 preceding siblings ...)
  2005-06-07 18:45 ` giovannibajo at libero dot it
@ 2005-06-07 19:07 ` reichelt at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-06-07 19:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-06-07 19:07 -------
> There is a DR and surely another bug report about this. It's uncertain whether 
> typename is needed to disambiguate a qualified name where the scope is the 
> injected class name (which always refers to the current instantiation).

You're right Giovanni, it's DR 409.

The proposed solution is to not require the "typename".
But then we'd also have a bug, because GCC had to accept the declaration
A::B b;

So with either outcome of the DR, we'll have to change the compiler.
Let's suspend it until the DR is solved.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED
            Summary|No typename required when   |[DR 409] Typename for
                   |type use in a function      |required for qualified name?


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


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

end of thread, other threads:[~2005-06-07 19:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 14:40 [Bug c++/21783] New: No typedef required when type use in a function florent dot gallet at orange dot fr
2005-05-27 14:42 ` [Bug c++/21783] No typename " florent dot gallet at orange dot fr
2005-05-27 14:43 ` florent dot gallet at orange dot fr
2005-05-27 14:48 ` pinskia at gcc dot gnu dot org
2005-05-27 15:02 ` florent dot gallet at orange dot fr
2005-05-27 15:25 ` florent dot gallet at orange dot fr
2005-05-27 15:50 ` florent dot gallet at orange dot fr
2005-06-07 17:07 ` reichelt at gcc dot gnu dot org
2005-06-07 18:45 ` giovannibajo at libero dot it
2005-06-07 19:07 ` [Bug c++/21783] [DR 409] Typename for required for qualified name? 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).