Skip to content

Missed guaranteed copy elision during implicit conversion and constructor delegation. #34037

Open
@llvmbot

Description

@llvmbot
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.

https://godbolt.org/g/c1Aouy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"waiting-for-wg21Blocked on C++ Standards Committee

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions