1 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify -DPEDANTIC %s
2 // RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify %s
3 // RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify -std=c++11 %s
5 // RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t
6 // RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t
12 // This warning is only produced if we specify -Wextra-semi, and not if only
13 // -pedantic is specified, since one semicolon is technically permitted.
14 // expected-warning@-4{{extra ';' after member function definition}}
16 void A2b() { };; // expected-warning{{extra ';' after member function definition}}
17 ; // expected-warning{{extra ';' inside a class}}
21 // expected-warning@-2{{extra ';' after member function definition}}
23 void A3() { }; ;; // expected-warning{{extra ';' after member function definition}}
24 ;;;;;;; // expected-warning{{extra ';' inside a class}}
25 ; // expected-warning{{extra ';' inside a class}}
26 ; ;; ; ;;; // expected-warning{{extra ';' inside a class}}
27 ; ; ; ; ;; // expected-warning{{extra ';' inside a class}}
33 int a2
;; // expected-warning{{extra ';' inside a union}}
38 #if __cplusplus < 201103L
39 // expected-warning@-3{{extra ';' outside of a function is a C++11 extension}}
40 // expected-warning@-3{{extra ';' outside of a function is a C++11 extension}}
41 #elif !defined(PEDANTIC)
42 // expected-warning@-6{{extra ';' outside of a function is incompatible with C++98}}
43 // expected-warning@-6{{extra ';' outside of a function is incompatible with C++98}}