[Bug c++/86997] error: call of overloaded ‘NoDestructor()’ is ambiguous

2018-11-09 Thread jengelh at inai dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86997

Jan Engelhardt  changed:

   What|Removed |Added

 CC||jengelh at inai dot de

--- Comment #4 from Jan Engelhardt  ---
>Is it trying to construct an 'a' object and pass that to the NoDestructor? Or 
>just default construct the NoDestructor object?

As I read it, it's definitely the 1-arg form (always), not the default ctor.

auto a = NoDestructor(); // NoDestructor a;
auto b = NoDestructor{}; // NoDestructor b{};
auto c = NoDestructor({}); // NoDestructor c({});
auto d = NoDestructor{{}}; // NoDestructor d{{}};

The actual chromium code is something like

  template class NoDestructor { ... }

and is used as

  NoDestructor> google_tlds({"foo"});

which means ({}), if it appears, was intended to mean the empty set, and this
empty set is passed as the first and only parameter to the NoDestructor 1-arg
ctor.

[Bug c++/86997] error: call of overloaded ‘NoDestructor()’ is ambiguous

2018-08-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86997

--- Comment #3 from Jonathan Wakely  ---
Don't write weird code?

Either of these works fine and is obvious what it is supposed to do:

  NoDestructor b;
  NoDestructor b{};

The original is weird. Is it trying to construct an 'a' object and pass that to
the NoDestructor? Or just default construct the NoDestructor object?

[Bug c++/86997] error: call of overloaded ‘NoDestructor()’ is ambiguous

2018-08-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86997

--- Comment #2 from Martin Liška  ---
(In reply to Jonathan Wakely from comment #1)
> Looks like a dup of PR 59389

Any easy workaround for it?

[Bug c++/86997] error: call of overloaded ‘NoDestructor()’ is ambiguous

2018-08-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86997

--- Comment #1 from Jonathan Wakely  ---
Looks like a dup of PR 59389

[Bug c++/86997] error: call of overloaded ‘NoDestructor()’ is ambiguous

2018-08-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86997

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-08-17
 CC||nathan at gcc dot gnu.org
 Ever confirmed|0   |1