This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49205] [C++0x] Default constructor with pack expansion parameter not detected


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

--- Comment #7 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-06-20 15:56:42 UTC ---
(In reply to comment #6)
> (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.
> 
> I disagree with this.  As Johannes points out, it is possible to have a
> template default constructor in C++03, so changing this would be a significant
> change.  We should just treat the variadic template as a default constructor.

To be fair to Sean, I should note that my example relied on a C++0x feature. If
we remove the template default argument:

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

This constructor cannot really be called "with arguments" anymore (there's no
deduction from default arguments), which is the condition under which a
constructor becomes a default constructor.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]