aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-extra-semi.cpp
blob: 35c886b63b274c51c2f4b2b507d0b430733f9843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify %s
// RUN: cp %s %t
// RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t
// RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t

class A {
  void A1();
  void A2() { }; // expected-warning{{extra ';' after function definition}}
  ; // expected-warning{{extra ';' inside a class}}
  void A3() { };  ;; // expected-warning{{extra ';' after function definition}}
  ;;;;;;; // expected-warning{{extra ';' inside a class}}
  ; // expected-warning{{extra ';' inside a class}}
  ; ;;		 ;  ;;; // expected-warning{{extra ';' inside a class}}
    ;  ; 	;	;  ;; // expected-warning{{extra ';' inside a class}}
  void A4();
};

union B {
  int a1;
  int a2;; // expected-warning{{extra ';' inside a union}}
};

; // expected-warning{{extra ';' outside of a function}}
; ;;// expected-warning{{extra ';' outside of a function}}