public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "td-gnubugs at th-dorner dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/41725]  New: g++ accepts compounded unnamed type in template (violates 14.3.1-2)
Date: Fri, 16 Oct 2009 08:46:00 -0000	[thread overview]
Message-ID: <bug-41725-18323@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2009-10-16  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16  8:46 td-gnubugs at th-dorner dot de [this message]
2009-10-16  8:59 ` [Bug c++/41725] " td-gnubugs at th-dorner dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-41725-18323@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).