forked from OSchip/llvm-project
Avoid C++17 guaranteed copy elision when testing for non-copyability
llvm-svn: 289033
This commit is contained in:
parent
cd9d374337
commit
009259da8a
|
@ -17,9 +17,9 @@
|
|||
#include <streambuf>
|
||||
#include <cassert>
|
||||
|
||||
std::streambuf get();
|
||||
std::streambuf &get();
|
||||
|
||||
int main()
|
||||
{
|
||||
std::streambuf sb = get();
|
||||
std::streambuf sb = get(); // expected-error {{calling a protected constructor}}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ typedef volatile std::packaged_task<A(int, char)> VPT;
|
|||
|
||||
int main()
|
||||
{
|
||||
PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
|
||||
VPT init{};
|
||||
PT p{init}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
|
||||
// expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue