public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41725]  New: g++ accepts compounded unnamed type in template (violates 14.3.1-2)
@ 2009-10-16  8:46 td-gnubugs at th-dorner dot de
  2009-10-16  8:59 ` [Bug c++/41725] " td-gnubugs at th-dorner dot de
  0 siblings, 1 reply; 6+ messages in thread
From: td-gnubugs at th-dorner dot de @ 2009-10-16  8:46 UTC (permalink / raw)
  To: gcc-bugs

g++ accepts a type as a template argument, that is defined inside of an unnamed
type.
In the attached example t_inner is defined in an unnamed structure.  That would
make t_inner a "type compounded from an unnamed type" as I read section
14.3.1-2 of the ISO/IEC 14882/1998 standard (p. 241).
So this should cause an error (and does with other Compilers / tools), but g++
accepts it.

The problem was found with:
> gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ../gcc-4.2.4/configure --prefix=/usr/local/gcc424
Thread model: posix
gcc version 4.2.4

It has also been verified with:
> gcc -v
Reading specs from /usr/local/gcc344/lib/gcc/sparc-sun-solaris2.10/3.4.4/specs
Configured with: ./configure --prefix=/usr/local/gcc344
Thread model: posix
gcc version 3.4.4

It has also been seen with version 4.3.3 on Linux (Ubuntu 9.04 on 64bit Intel).

The Comeau online compiler gives an "a template argument may not reference an
unnamed type" error message for that code.


-- 
           Summary: g++ accepts compounded unnamed type in template
                    (violates 14.3.1-2)
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: td-gnubugs at th-dorner dot de
 GCC build triplet: sparc-sun-solaris2.10
  GCC host triplet: sparc-sun-solaris2.10
GCC target triplet: sparc-sun-solaris2.10


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


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

end of thread, other threads:[~2013-06-10 16:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-41725-4@http.gcc.gnu.org/bugzilla/>
2011-09-28 21:32 ` [Bug c++/41725] g++ accepts compounded unnamed type in template (violates 14.3.1-2) paolo.carlini at oracle dot com
2011-09-29  2:20 ` jason at gcc dot gnu.org
2013-06-10  9:38 ` paolo.carlini at oracle dot com
2013-06-10 15:59 ` jason at gcc dot gnu.org
2013-06-10 16:03 ` jason at gcc dot gnu.org
2009-10-16  8:46 [Bug c++/41725] New: " td-gnubugs at th-dorner dot de
2009-10-16  8:59 ` [Bug c++/41725] " td-gnubugs at th-dorner dot de

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