https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #10 from Ruslan Nikolaev ---
The latter example seems to work well for both gcc and clang. The behavior is
also consistent for both explicit and implicit constructors.
Thank you for clarifying that it was not a bug!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #9 from Ruslan Nikolaev ---
Interestingly, if I change the code a little bit and have a pair in the
constructor rather than two arguments, gcc seems to compile the code:
#include
#include
struct PairPtr {
PairPtr() {}
P
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
Andrew Pinski changed:
What|Removed |Added
Resolution|INVALID |DUPLICATE
--- Comment #8 from Andrew Pi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |INVALID
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #6 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #4)
> I think GCC and MSVC are correct here:
> [over.match.list]/16.3.1.7
> . In copy-listinitialization, if an explicit constructor is chosen, the
> initialization is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #5 from Andrew Pinski ---
Actually I think there is some disagreement if dcl.init.list/3.4 (that is
aggregate initialization) applies ...
Because if I make the two fields private, then gcc (and MSVC) accepts it ...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #4 from Andrew Pinski ---
I think GCC and MSVC are correct here:
[over.match.list]/16.3.1.7
. In copy-listinitialization, if an explicit constructor is chosen, the
initialization is ill-formed. [ Note: This differs from
other situati
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #3 from Andrew Pinski ---
Obvious workaround is to do:
p = PairPtr{ a, b };
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
Andrew Pinski changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107958
--- Comment #1 from Andrew Pinski ---
Note MSVC (with /std:c++latest) also rejects the source that is in comment #0
for the same reason as GCC:
(39): error C2593: 'operator =' is ambiguous
(25): note: could be 'PairPtr &PairPtr::operator =(cons
10 matches
Mail list logo