diff options
Diffstat (limited to 'test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp')
-rw-r--r-- | test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp index 5467a9222c07f..e03c2164bae12 100644 --- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp +++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s void nondecl(int (*f)(int x = 5)) // expected-error {{default arguments can only be specified}} { @@ -8,6 +8,9 @@ void nondecl(int (*f)(int x = 5)) // expected-error {{default arguments can only struct X0 { int (*f)(int = 17); // expected-error{{default arguments can only be specified for parameters in a function declaration}} + void (*g())(int = 22); // expected-error{{default arguments can only be specified for parameters in a function declaration}} + void (*h(int = 49))(int); + auto i(int) -> void (*)(int = 9); // expected-error{{default arguments can only be specified for parameters in a function declaration}} void mem8(int (*fp)(int) = (int (*)(int = 17))0); // expected-error{{default arguments can only be specified for parameters in a function declaration}} }; |