[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / dcl.decl / dcl.meaning / dcl.fct / dcl.fct.def.default / p1.cpp
blob21f71f05419cd03be740ea5d74e401b18d7b7a04
1 // RUN: %clang_cc1 -std=c++11 -verify %s
3 // A function that is explicitly defaulted shall
4 // [...]
5 // -- not have default arguments
6 struct DefArg {
7 static DefArg &&make();
8 DefArg(int n = 5) = default; // expected-error {{an explicitly-defaulted constructor cannot have default arguments}}
9 DefArg(const DefArg &DA = make()) = default; // expected-error {{an explicitly-defaulted constructor cannot have default arguments}}
10 DefArg(const DefArg &DA, int k = 3) = default; // expected-error {{an explicitly-defaulted copy constructor cannot have default arguments}}
11 DefArg(DefArg &&DA = make()) = default; // expected-error {{an explicitly-defaulted constructor cannot have default arguments}}
12 DefArg(DefArg &&DA, int k = 3) = default; // expected-error {{an explicitly-defaulted move constructor cannot have default arguments}}
13 DefArg &operator=(const DefArg&, int k = 4) = default; // expected-error {{parameter of overloaded 'operator=' cannot have a default argument}}
14 DefArg &operator=(DefArg&&, int k = 4) = default; // expected-error {{parameter of overloaded 'operator=' cannot have a default argument}}
15 ~DefArg(int k = 5) = default; // expected-error {{destructor cannot have any parameters}}