Open
Description
Bugzilla Link | 34689 |
Version | 5.0 |
OS | Linux |
Attachments | Example source file. |
Reporter | LLVM Bugzilla Contributor |
CC | @davidstone |
Extended Description
Various guaranteed copy elisions are inconsistently missed depending on copy or direct initialization. See the attached file for the sample source file. For reference it compiles on g++ 7.1.0, I didn't test runtime behavior though.
I compiled with clang++-5.0 -std=c++1z -Wall -pedantic -c -o copy_elision.o copy_elision.cpp
Got 7 errors at the marked places, all complaining about the deleted move and copy constructors.
I think the attached source file is well-formed and it should compile.
$ uname -a
Linux lenard-hp 4.9.0-3-amd64 #​1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux
$ clang++-5.0 --version
clang version 5.0.0-2 (tags/RELEASE_500/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin