Douglas Gregor | a527130 | 2011-01-26 20:35:32 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s |
| 2 | |
Douglas Gregor | 205d044 | 2011-10-12 19:26:40 +0000 | [diff] [blame] | 3 | inline namespace N { // expected-warning{{inline namespaces are a C++11 feature}} |
Douglas Gregor | a527130 | 2011-01-26 20:35:32 +0000 | [diff] [blame] | 4 | struct X { |
Douglas Gregor | 205d044 | 2011-10-12 19:26:40 +0000 | [diff] [blame] | 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}} |
Douglas Gregor | a527130 | 2011-01-26 20:35:32 +0000 | [diff] [blame] | 8 | }; |
| 9 | } |
| 10 | |
Richard Smith | a34f9c7 | 2011-10-15 04:01:16 +0000 | [diff] [blame] | 11 | struct B { |
| 12 | virtual void f(); |
Alexander Potapenko | e2e8b0e | 2014-10-03 09:02:53 +0000 | [diff] [blame] | 13 | virtual void g(); |
Richard Smith | a34f9c7 | 2011-10-15 04:01:16 +0000 | [diff] [blame] | 14 | }; |
Richard Smith | e434590 | 2011-12-29 21:57:33 +0000 | [diff] [blame] | 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}} |
Alexander Potapenko | e2e8b0e | 2014-10-03 09:02:53 +0000 | [diff] [blame] | 17 | virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}} |
Richard Smith | a34f9c7 | 2011-10-15 04:01:16 +0000 | [diff] [blame] | 18 | }; |
Richard Smith | 6b46488 | 2011-10-15 04:11:50 +0000 | [diff] [blame] | 19 | |
| 20 | void NewBracedInitList() { |
| 21 | // A warning on this would be sufficient once we can handle it correctly. |
| 22 | new int {}; // expected-error {{}} |
| 23 | } |
Richard Smith | fb8b7b9 | 2013-10-15 00:00:26 +0000 | [diff] [blame] | 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}} |
Richard Smith | 0b350b9 | 2014-10-28 16:55:02 +0000 | [diff] [blame] | 31 | |
| 32 | struct Conv { template<typename T> operator T(); }; |
| 33 | bool pr21367_a = new int && false; |
| 34 | bool pr21367_b = &Conv::operator int && false; |