[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / extra-semi.cpp
blobbe7435a4068187a7004bcae090149aee4928cb61
1 // RUN: %clang_cc1 -verify -std=c++98 -Wextra-semi %s
2 // RUN: %clang_cc1 -verify -std=c++03 -Wextra-semi %s
3 // RUN: %clang_cc1 -verify -std=c++11 -Wextra-semi %s
4 // RUN: %clang_cc1 -verify -std=c++17 -Wextra-semi %s
5 // RUN: %clang_cc1 -verify -std=c++2a -Wextra-semi %s
6 // RUN: %clang_cc1 -verify -Weverything -Wno-c++98-compat %s
7 // RUN: %clang_cc1 -verify -Weverything -Wno-c++98-compat-pedantic -Wc++98-compat-extra-semi %s
9 // Last RUN line checks that c++98-compat-extra-semi can still be re-enabled.
11 void F();
13 void F(){}
15 #if __cplusplus < 201103L
16 // expected-warning@-2{{extra ';' outside of a function is a C++11 extension}}
17 #else
18 // expected-warning@-4{{extra ';' outside of a function is incompatible with C++98}}
19 #endif
21 namespace ns {
22 class C {
23 void F() const;
26 ; // expected-warning {{extra ';' outside of a function is}}
28 void ns::C::F() const {}
29 ; // expected-warning {{extra ';' outside of a function is}}