public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17267] New: Template parameter redeclaration
@ 2004-09-01 19:37 v dot haisman at sh dot cvut dot cz
  2004-09-01 20:46 ` [Bug c++/17267] " pinskia at gcc dot gnu dot org
  2004-09-07 23:09 ` [Bug c++/17267] Reuse of template parameter name not diagnosed bangerth at dealii dot org
  0 siblings, 2 replies; 3+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2004-09-01 19:37 UTC (permalink / raw)
  To: gcc-bugs

Comeau rejects this while GCC accepts it:

template <typename T, template <typename T> class C>
void f ()
{ }

WilX@amber2:::~/tmp> g++-3.5 -v
Reading specs from /usr/local/lib/gcc/i686-pc-cygwin/3.5.0/specs
Configured with: ../srcdir/configure --with-gcc --with-gnu-ld --with-gnu-as --en
able-languages=c,c++,objc --enable-threads=posix --with-system-zlib --enable-nls
 --without-included-gettext --enable-sjlj-exceptions --enable-version-specific-r
untime-libs --enable-shared --disable-win32-registry --enable-dwarf2 --with-cpu=
athlon-tbird --with-arch=athlon-tbird --program-suffix=-3.5
Thread model: posix
gcc version 3.5.0 20040826 (experimental)

-- 
           Summary: Template parameter redeclaration
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
                CC: gcc-bugs at gcc dot gnu dot org,v dot haisman at sh dot
                    cvut dot cz
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


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

* [Bug c++/17267] Template parameter redeclaration
  2004-09-01 19:37 [Bug c++/17267] New: Template parameter redeclaration v dot haisman at sh dot cvut dot cz
@ 2004-09-01 20:46 ` pinskia at gcc dot gnu dot org
  2004-09-07 23:09 ` [Bug c++/17267] Reuse of template parameter name not diagnosed bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-01 20:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-01 20:46 -------
Hmm, I leave this one for a C++ expect but I should note that ICC 8.0 accepts the code too even in 
strict mode (-Xc -ansi) but I see that Comeau rejects it so ...

-- 


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


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

* [Bug c++/17267] Reuse of template parameter name not diagnosed
  2004-09-01 19:37 [Bug c++/17267] New: Template parameter redeclaration v dot haisman at sh dot cvut dot cz
  2004-09-01 20:46 ` [Bug c++/17267] " pinskia at gcc dot gnu dot org
@ 2004-09-07 23:09 ` bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2004-09-07 23:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-07 23:09 -------
The name of the inner template template parameter is (properly) ignored, 
so even if we accept this it does not harm. 
 
I can't really find any place where it would say that we have to reject 
the code. 14.1/3 would probably come closest, saying that we have to 
treat the second occurrence of "T" as naming a type, not a paramater name. 
This is elaborated in 14.1/13. So even if there is no clear requirement 
that we must reject the code, it would probably be a reasonable request, 
though of low priority. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-07 23:09:04
               date|                            |
            Summary|Template parameter          |Reuse of template parameter
                   |redeclaration               |name not diagnosed


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


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

end of thread, other threads:[~2004-09-07 23:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-01 19:37 [Bug c++/17267] New: Template parameter redeclaration v dot haisman at sh dot cvut dot cz
2004-09-01 20:46 ` [Bug c++/17267] " pinskia at gcc dot gnu dot org
2004-09-07 23:09 ` [Bug c++/17267] Reuse of template parameter name not diagnosed bangerth at dealii 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).