public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/15865] [DR 147] Invalid variable definition through the constructor name
Date: Fri, 27 Aug 2004 01:21:00 -0000	[thread overview]
Message-ID: <20040827012107.24290.qmail@sourceware.org> (raw)
In-Reply-To: <20040608021123.15865.giovannibajo@libero.it>


------- Additional Comments From giovannibajo at libero dot it  2004-08-27 01:21 -------
That is misleading, DR 147 clarifies this. It adds this paragraph to 
[class.qual]:


  If  the  nested-name-specifier  nominates  a  class  C,  and  the name
  specified after the nested-name-specifier, when looked up in C, is the
  injected-class-name  of  C  (clause  _class_),  the  name  is  instead
  considered to name the constructor of class  C.   Such  a  constructor
  name  shall  be  used  only  in  the  declarator-id  of  a constructor
  definition that appears outside of the class definition.  [Example:

     struct A { A(); };
     struct B: public A { B(); };

     A::A() { }
     B::B() { }

     B::A ba;                        // object of type A
     A::A a;                         // error, A::A is not a type name

   --end example]

See also testsuite/g++.dg/tc1/dr147.C (xfailed).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |
            Summary|Invalid variable definition |[DR 147] Invalid variable
                   |through the constructor name|definition through the
                   |                            |constructor name


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


  parent reply	other threads:[~2004-08-27  1:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-08  2:11 [Bug c++/15865] New: " giovannibajo at libero dot it
2004-06-08  2:29 ` [Bug c++/15865] " pinskia at gcc dot gnu dot org
2004-06-29 17:20 ` giovannibajo at libero dot it
2004-08-17 17:11 ` reichelt at gcc dot gnu dot org
2004-08-27  1:09 ` giovannibajo at libero dot it
2004-08-27  1:11 ` pinskia at gcc dot gnu dot org
2004-08-27  1:21 ` giovannibajo at libero dot it [this message]
2004-08-27  1:23 ` [Bug c++/15865] [DR 147] " giovannibajo at libero dot it
2004-08-27  1:52 ` pinskia at gcc dot gnu dot org

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=20040827012107.24290.qmail@sourceware.org \
    --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).