]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Parser/cxx0x-in-cxx98.cpp
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / Parser / cxx0x-in-cxx98.cpp
1 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
2
3 inline namespace N { // expected-warning{{inline namespaces are a C++11 feature}}
4 struct X {
5   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}}
8 };
9 }
10
11 struct B {
12   virtual void f();
13   virtual void g();
14 };
15 struct 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}}
17   virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}}
18 };
19
20 void NewBracedInitList() {
21   // A warning on this would be sufficient once we can handle it correctly.
22   new int {}; // expected-error {{}}
23 }
24
25 struct Auto {
26   static int n;
27 };
28 auto Auto::n = 0; // expected-warning {{'auto' type specifier is a C++11 extension}}
29 auto Auto::m = 0; // expected-error {{no member named 'm' in 'Auto'}}
30                   // expected-warning@-1 {{'auto' type specifier is a C++11 extension}}