Open Quuxplusone opened 10 years ago
Bugzilla Link | PR19916 |
Status | NEW |
Importance | P normal |
Reported by | hstong@ca.ibm.com |
Reported on | 2014-06-01 21:32:06 -0700 |
Last modified on | 2015-03-25 12:35:21 -0700 |
Version | trunk |
Hardware | All All |
CC | dgregor@apple.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Much simpler case; Clang errors out when trying match cv-qualification because
it tries to create a temporary but could not find an appropriate constructor:
### SOURCE (<stdin>):
struct A { };
A &&f1();
volatile A &&f2();
void g(bool cond) {
cond ? f1() : f2();
}
### COMPILER INVOCATION:
clang++ -cc1 -std=c++11 -x c++ -
### OUTPUT:
<stdin>:7:11: error: no matching constructor for initialization of 'volatile A'
cond ? f1() : f2();
^~~~
<stdin>:1:8: note: candidate constructor (the implicit copy constructor) not
viable: 1st argument ('volatile A') would lose volatile qualifier
struct A { };
^
<stdin>:1:8: note: candidate constructor (the implicit move constructor) not
viable: 1st argument ('volatile A') would lose volatile qualifier
struct A { };
^
<stdin>:1:8: note: candidate constructor (the implicit default constructor) not
viable: requires 0 arguments, but 1 was provided
1 error generated.
### COMPILER VERSION INFO:
clang version 3.7.0 (trunk 233189)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/local/gcc-4.8.2/lib/gcc/x86_64-unknown-
linux-gnu/4.8.2
Selected GCC installation: /usr/local/gcc-4.8.2/lib/gcc/x86_64-unknown-linux-
gnu/4.8.2
Candidate multilib: .;@m64
Selected multilib: .;@m64