• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 
3 int i = delete; // expected-error{{only functions}}
4 int j = default; // expected-error{{special member functions}}
5 
6 int f() = delete, g; // expected-error{{'= delete' is a function definition}}
7 int o, p() = delete; // expected-error{{'= delete' is a function definition}}
8 
9 int q() = default, r; // expected-error{{only special member functions}} \
10                       // expected-error{{'= default' is a function definition}}
11 int s, t() = default; // expected-error{{'= default' is a function definition}}
12 
13 struct foo {
14   foo() = default;
15   ~foo() = delete;
16   void bar() = delete;
17 };
18 
19 void baz() = delete;
20 
21 struct quux {
22   int quux() = default; // expected-error{{constructor cannot have a return type}}
23 };
24