blob: 10cb4d2fa53aac20025b97d717d377a5e2b42558 [file] [log] [blame]
Douglas Gregora5271302011-01-26 20:35:32 +00001// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
2
Douglas Gregor205d0442011-10-12 19:26:40 +00003inline namespace N { // expected-warning{{inline namespaces are a C++11 feature}}
Douglas Gregora5271302011-01-26 20:35:32 +00004struct X {
Douglas Gregor205d0442011-10-12 19:26:40 +00005 template<typename ...Args> // expected-warning{{variadic templates are a C++11 extension}}
6 void f(Args &&...) &; // expected-warning{{rvalue references are a C++11 extension}} \
7 // expected-warning{{reference qualifiers on functions are a C++11 extension}}
Douglas Gregora5271302011-01-26 20:35:32 +00008};
9}
10
Richard Smitha34f9c72011-10-15 04:01:16 +000011struct B {
12 virtual void f();
Alexander Potapenkoe2e8b0e2014-10-03 09:02:53 +000013 virtual void g();
Richard Smitha34f9c72011-10-15 04:01:16 +000014};
Richard Smithe4345902011-12-29 21:57:33 +000015struct D final : B { // expected-warning {{'final' keyword is a C++11 extension}}
16 virtual void f() override; // expected-warning {{'override' keyword is a C++11 extension}}
Alexander Potapenkoe2e8b0e2014-10-03 09:02:53 +000017 virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}}
Richard Smitha34f9c72011-10-15 04:01:16 +000018};
Richard Smith6b464882011-10-15 04:11:50 +000019
20void NewBracedInitList() {
21 // A warning on this would be sufficient once we can handle it correctly.
22 new int {}; // expected-error {{}}
23}
Richard Smithfb8b7b92013-10-15 00:00:26 +000024
25struct Auto {
26 static int n;
27};
28auto Auto::n = 0; // expected-warning {{'auto' type specifier is a C++11 extension}}
29auto Auto::m = 0; // expected-error {{no member named 'm' in 'Auto'}}
30 // expected-warning@-1 {{'auto' type specifier is a C++11 extension}}
Richard Smith0b350b92014-10-28 16:55:02 +000031
32struct Conv { template<typename T> operator T(); };
33bool pr21367_a = new int && false;
34bool pr21367_b = &Conv::operator int && false;