2015-01-27 11:30:40 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
|
|
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
|
|
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
|
|
// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
|
|
|
2015-02-19 15:28:49 +08:00
|
|
|
namespace std { struct type_info; }
|
|
|
|
|
2015-01-27 11:30:40 +08:00
|
|
|
namespace dr1902 { // dr1902: 3.7
|
|
|
|
struct A {};
|
|
|
|
struct B {
|
|
|
|
B(A);
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
// expected-note@-2 {{candidate}}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
B() = delete;
|
|
|
|
#if __cplusplus < 201103L
|
|
|
|
// expected-error@-2 {{extension}}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
B(const B&) // expected-note {{deleted here}}
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
// expected-note@-2 {{candidate}}
|
|
|
|
#else
|
|
|
|
// expected-error@+2 {{extension}}
|
|
|
|
#endif
|
|
|
|
= delete;
|
|
|
|
|
|
|
|
operator A();
|
|
|
|
};
|
|
|
|
|
|
|
|
extern B b1;
|
|
|
|
B b2(b1); // expected-error {{call to deleted}}
|
|
|
|
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
// This is ambiguous, even though calling the B(const B&) constructor would
|
|
|
|
// both directly and indirectly call a deleted function.
|
|
|
|
B b({}); // expected-error {{ambiguous}}
|
|
|
|
#endif
|
|
|
|
}
|
2015-02-19 15:28:49 +08:00
|
|
|
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
namespace dr1968 { // dr1968: yes
|
|
|
|
static_assert(&typeid(int) == &typeid(int), ""); // expected-error{{not an integral constant expression}}
|
|
|
|
}
|
|
|
|
#endif
|