public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "schaub.johannes at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49205] [C++0x] Default constructor with pack expansion parameter not detected
Date: Sat, 28 May 2011 01:55:00 -0000	[thread overview]
Message-ID: <bug-49205-4-KFll2gmiRY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49205-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-05-28 01:45:29 UTC ---
(In reply to comment #1)
> While this behavior is erroneous, consensus at clang was that WG21 made an
> oversight in allowing this. Template constructors are banned from being copy or
> move constructors, and historically this prohibition was not necessary for
> default constructors since there was no special handling of them except when
> implicit.

That rationale makes sense. I wonder about the implications for value
initialization though. If that constructor is not a default constructor, then
"A();" appears to be ill-formed, because of the saying in 8.5p7 that we shall
call "the default constructor". 

Also, how should the rules be drawn? Is any template not a default constructor?
Then what about the following?

  template<typename T = int> A(T = 0); 

GCC appears to deem it a default constructor. Is the following rule acceptable?

- A default constructor is a constructor with zero parameters or that only has
parameters with default arguments and with an optional trailing ellipsis
("A(int, ...)").


  parent reply	other threads:[~2011-05-28  1:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28  0:48 [Bug c++/49205] New: " schaub.johannes at googlemail dot com
2011-05-28  1:46 ` [Bug c++/49205] " coppro at users dot sourceforge.net
2011-05-28  1:55 ` schaub.johannes at googlemail dot com [this message]
2011-05-28  2:06 ` [Bug c++/49205] [C++0x] " scshunt at csclub dot uwaterloo.ca
2011-05-28  3:22 ` schaub.johannes at googlemail dot com
2011-06-20  1:53 ` jason at gcc dot gnu.org
2011-06-20 14:41 ` jason at gcc dot gnu.org
2011-06-20 14:46 ` jason at gcc dot gnu.org
2011-06-20 15:57 ` schaub.johannes at googlemail dot com

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-49205-4-KFll2gmiRY@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).