public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
@ 2013-10-30 20:52 ppluzhnikov at google dot com
  2013-11-15  0:56 ` [Bug c++/58930] " ppluzhnikov at google dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: ppluzhnikov at google dot com @ 2013-10-30 20:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58930
           Summary: [C++11] Bogus error: converting to ... from
                    initializer list would use explicit constructor
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/11448857

This is somewhat similar to PR54835.

// ---
struct SampleModule
{
   explicit SampleModule (int);
};

template < typename >
struct BaseHandler
{
#ifndef BUG
   BaseHandler ();
#endif
   SampleModule module_ { 0 };
};

BaseHandler<int> a;
// ---

Clang compiles either variant.
Trunk GCC (g++ (GCC) 4.9.0 20131028 (experimental)):

g++ -c -std=c++11 t.cc && echo ok && g++ -c -std=c++11 t.cc -DBUG
ok
t.cc: In constructor 'constexpr BaseHandler<int>::BaseHandler()':
t.cc:7:8: error: converting to 'SampleModule' from initializer list would use
explicit constructor 'SampleModule::SampleModule(int)'
 struct BaseHandler
       ^
t.cc: At global scope:
t.cc:15:18: note: synthesized method 'constexpr
BaseHandler<int>::BaseHandler()' first required here
 BaseHandler<int> a;
                 ^

Making BaseHandler a non-template class also makes the problem go away.


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
@ 2013-11-15  0:56 ` ppluzhnikov at google dot com
  2013-11-15 10:34 ` redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppluzhnikov at google dot com @ 2013-11-15  0:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Re-confirmed with current trunk:
g++ (GCC) 4.9.0 20131114 (experimental)


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
  2013-11-15  0:56 ` [Bug c++/58930] " ppluzhnikov at google dot com
@ 2013-11-15 10:34 ` redi at gcc dot gnu.org
  2014-05-15 12:21 ` paolo.carlini at oracle dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2013-11-15 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-15
            Version|unknown                     |4.9.0
             Blocks|                            |58616
     Ever confirmed|0                           |1


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
  2013-11-15  0:56 ` [Bug c++/58930] " ppluzhnikov at google dot com
  2013-11-15 10:34 ` redi at gcc dot gnu.org
@ 2014-05-15 12:21 ` paolo.carlini at oracle dot com
  2014-05-20 19:21 ` paolo at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-15 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2014-05-15 12:21 ` paolo.carlini at oracle dot com
@ 2014-05-20 19:21 ` paolo at gcc dot gnu.org
  2014-05-20 19:23 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-05-20 19:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue May 20 19:20:59 2014
New Revision: 210653

URL: http://gcc.gnu.org/viewcvs?rev=210653&root=gcc&view=rev
Log:
/cp
2014-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/58753
    PR c++/58930
    PR c++/58704
    * typeck2.c (digest_nsdmi_init): New.
    * parser.c (cp_parser_late_parse_one_default_arg): Use it.
    * init.c (get_nsdmi): Likewise.
    * cp-tree.h (digest_nsdmi_init): Declare.

/testsuite
2014-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/58753
    PR c++/58930
    PR c++/58704
    * g++.dg/cpp0x/nsdmi-template11.C: New.
    * g++.dg/cpp0x/nsdmi-template12.C: Likewise.
    * g++.dg/cpp0x/nsdmi-template13.C: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C
    trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C
    trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/init.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/typeck2.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2014-05-20 19:21 ` paolo at gcc dot gnu.org
@ 2014-05-20 19:23 ` paolo.carlini at oracle dot com
  2014-06-27  0:24 ` ppluzhnikov at google dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-20 19:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|---                         |4.10.0

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.10.0.


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2014-05-20 19:23 ` paolo.carlini at oracle dot com
@ 2014-06-27  0:24 ` ppluzhnikov at google dot com
  2014-06-27  9:18 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppluzhnikov at google dot com @ 2014-06-27  0:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #5 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Paolo Carlini from comment #4)
> Fixed for 4.10.0.

Can this be back-ported to gcc-4_9-branch?


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2014-06-27  0:24 ` ppluzhnikov at google dot com
@ 2014-06-27  9:18 ` paolo.carlini at oracle dot com
  2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-27  9:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
The patch isn't trivial but I understand that it fixes quite a few issues. Thus
certainly no objections from me. Just ask on the mailing list: if Jason agrees,
please go ahead. Thanks.


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (6 preceding siblings ...)
  2014-06-27  9:18 ` paolo.carlini at oracle dot com
@ 2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
  2014-11-18 12:01 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ppluzhnikov at gcc dot gnu.org @ 2014-07-01 18:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #7 from ppluzhnikov at gcc dot gnu.org ---
Author: ppluzhnikov
Date: Tue Jul  1 18:46:26 2014
New Revision: 212207

URL: https://gcc.gnu.org/viewcvs?rev=212207&root=gcc&view=rev
Log:
Backport r210653 from mainline:


gcc/teststuite/ChangeLog:

2014-07-01  Paul Pluzhnikov  <ppluzhnikov@google.com>

    PR c++/58753
    PR c++/58930
    PR c++/58704

    Backported from mainline
    2014-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

    * g++.dg/cpp0x/nsdmi-template11.C: New.
    * g++.dg/cpp0x/nsdmi-template12.C: Likewise.
    * g++.dg/cpp0x/nsdmi-template13.C: Likewise.

gcc/cp/ChangeLog:

2014-07-01  Paul Pluzhnikov  <ppluzhnikov@google.com>

    PR c++/58753
    PR c++/58930
    PR c++/58704

    Backported from mainline
    2014-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

    * typeck2.c (digest_nsdmi_init): New.
    * parser.c (cp_parser_late_parse_one_default_arg): Use it.
    * init.c (get_nsdmi): Likewise.
    * cp-tree.h (digest_nsdmi_init): Declare.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C
Modified:
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/cp-tree.h
    branches/gcc-4_9-branch/gcc/cp/init.c
    branches/gcc-4_9-branch/gcc/cp/parser.c
    branches/gcc-4_9-branch/gcc/cp/typeck2.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (7 preceding siblings ...)
  2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
@ 2014-11-18 12:01 ` paolo.carlini at oracle dot com
  2014-11-18 16:20 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-18 12:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 58940 has been marked as a duplicate of this bug. ***


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (8 preceding siblings ...)
  2014-11-18 12:01 ` paolo.carlini at oracle dot com
@ 2014-11-18 16:20 ` paolo.carlini at oracle dot com
  2014-11-19  9:17 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-18 16:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ja.gcc.bugzilla at aptsketch dot c
                   |                            |om

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 60258 has been marked as a duplicate of this bug. ***


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (9 preceding siblings ...)
  2014-11-18 16:20 ` paolo.carlini at oracle dot com
@ 2014-11-19  9:17 ` paolo.carlini at oracle dot com
  2014-11-19  9:18 ` paolo.carlini at oracle dot com
  2014-11-19  9:19 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-19  9:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |filip.roseen at gmail dot com

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 60698 has been marked as a duplicate of this bug. ***


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (10 preceding siblings ...)
  2014-11-19  9:17 ` paolo.carlini at oracle dot com
@ 2014-11-19  9:18 ` paolo.carlini at oracle dot com
  2014-11-19  9:19 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-19  9:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Let's adjust the Milestone: with the backport these bugs are fixed for 4.9.1.


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

* [Bug c++/58930] [C++11] Bogus error: converting to ... from initializer list would use explicit constructor
  2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
                   ` (11 preceding siblings ...)
  2014-11-19  9:18 ` paolo.carlini at oracle dot com
@ 2014-11-19  9:19 ` paolo.carlini at oracle dot com
  12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-19  9:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58930

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.0                         |4.9.1


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

end of thread, other threads:[~2014-11-19  9:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30 20:52 [Bug c++/58930] New: [C++11] Bogus error: converting to ... from initializer list would use explicit constructor ppluzhnikov at google dot com
2013-11-15  0:56 ` [Bug c++/58930] " ppluzhnikov at google dot com
2013-11-15 10:34 ` redi at gcc dot gnu.org
2014-05-15 12:21 ` paolo.carlini at oracle dot com
2014-05-20 19:21 ` paolo at gcc dot gnu.org
2014-05-20 19:23 ` paolo.carlini at oracle dot com
2014-06-27  0:24 ` ppluzhnikov at google dot com
2014-06-27  9:18 ` paolo.carlini at oracle dot com
2014-07-01 18:47 ` ppluzhnikov at gcc dot gnu.org
2014-11-18 12:01 ` paolo.carlini at oracle dot com
2014-11-18 16:20 ` paolo.carlini at oracle dot com
2014-11-19  9:17 ` paolo.carlini at oracle dot com
2014-11-19  9:18 ` paolo.carlini at oracle dot com
2014-11-19  9:19 ` paolo.carlini at oracle dot com

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