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

--- Comment #4 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> You are mostly correct.
> In C++17, Copy elision is guaranteed to be done here while in earlier
> versions it is not and earlier versions of C++ require a copy/move
> constructor even if copy elision is to be done. See
> https://en.cppreference.com/w/cpp/language/copy_elision for more information.

So before this "copy elision", there'd be temporaries constructed and then
copied into other temporaries, this in an object that is essentially just
declared, without initializer?  Weird.  Thanks for the pointer; I guess that's
the general idea, but here there'd be no difference.  IOW, sounds like the
patch is right.

If we move past the difference in semantics of the idioms in the patch, I still
don't see why there actually was error for the original syntax.  There must be
something in the difference between the hash_map and hash_set declarations. 
Eagerly awaiting comments on the patch.  (Probably not the best way to learn
recent C++ standards, but believe it or not, I'm exposed to a worse way, on
another track... :)

Reply via email to