1 // RUN: %clang_cc1 -std=c++98 %s -Wdeprecated -verify -triple x86_64-linux-gnu
2 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify -triple x86_64-linux-gnu
3 // RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify -triple x86_64-linux-gnu
5 // RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify -triple x86_64-linux-gnu -Wno-deprecated-register -DNO_DEPRECATED_FLAGS
7 #include "Inputs/register.h"
12 #if __cplusplus >= 201103L
13 // expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept' instead}}
14 // expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}}
15 // expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}}
20 #if __cplusplus >= 201103L && !defined(NO_DEPRECATED_FLAGS)
21 // expected-warning@-2 {{'register' storage class specifier is deprecated}}
24 register int m asm("rbx"); // no-warning
26 int k = to_int(n); // no-warning
29 ++b; // expected-warning {{incrementing expression of type bool is deprecated}}
31 // FIXME: This is ill-formed in C++11.
32 char *p = "foo"; // expected-warning {{conversion from string literal to 'char *' is deprecated}}
36 struct T : private S {
38 #if __cplusplus < 201103L
39 // expected-warning@-2 {{access declarations are deprecated; use using declarations instead}}
41 // expected-error@-4 {{ISO C++11 does not allow access declarations; use using declarations instead}}
45 #if __cplusplus >= 201103L
46 namespace DeprecatedCopy {
48 Assign &operator=(const Assign&); // expected-warning {{definition of implicit copy constructor for 'Assign' is deprecated because it has a user-declared copy assignment operator}}
50 Assign a1, a2(a1); // expected-note {{implicit copy constructor for 'Assign' first required here}}
54 Ctor(const Ctor&); // expected-warning {{definition of implicit copy assignment operator for 'Ctor' is deprecated because it has a user-declared copy constructor}}
57 void f() { b1 = b2; } // expected-note {{implicit copy assignment operator for 'Ctor' first required here}}
61 // expected-warning@-1 {{definition of implicit copy constructor for 'Dtor' is deprecated because it has a user-declared destructor}}
62 // expected-warning@-2 {{definition of implicit copy assignment operator for 'Dtor' is deprecated because it has a user-declared destructor}}
64 Dtor c1, c2(c1); // expected-note {{implicit copy constructor for 'Dtor' first required here}}
65 void g() { c1 = c2; } // expected-note {{implicit copy assignment operator for 'Dtor' first required here}}