[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / class.derived / p1.cpp
blobdc5cb2b8c2a3890ae15bbb36513ab5d9dff5afb8
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
3 // base-clause:
4 // : base-specifier-list
5 // base-specifier-list:
6 // base-specifier ...[opt]
7 // base-specifier-list , base-specifier ...[opt]
8 // base-specifier:
9 // attribute-specifier-seq[opt] base-type-specifier
10 // attribute-specifier-seq[opt] virtual access-specifier[opt] base-type-specifier
11 // attribute-specifier-seq[opt] access-specifier virtual[opt] base-type-specifier
12 // class-or-decltype:
13 // nested-name-specifier[opt] class-name
14 // decltype-specifier
15 // base-type-specifier:
16 // class-or-decltype
17 // access-specifier:
18 // private
19 // protected
20 // public
22 namespace PR11216 {
23 struct Base { };
24 struct Derived : decltype(Base()) { };
26 int func();
27 struct Derived2 : decltype(func()) { }; // expected-error {{base specifier must name a class}}
29 template<typename T>
30 struct Derived3 : decltype(T().foo()) { };
31 struct Foo { Base foo(); };
32 Derived3<Foo> d;
34 struct Derived4 : :: decltype(Base()) { }; // expected-error {{unexpected namespace scope prior to decltype}}
36 struct Derived5 : PR11216:: decltype(Base()) { }; // expected-error {{unexpected namespace scope prior to decltype}}
38 template<typename T>
39 struct Derived6 : typename T::foo { }; // expected-error {{'typename' is redundant; base classes are implicitly types}}