Debian Codegraph @

clang/test/CXX/basic/basic.start/basic.start.init/p3.cpp

raw
1 // RUN: %clang_cc1 -verify %s -pedantic-errors
2 // RUN: %clang_cc1 -verify %s -pedantic-errors -DINLINE
3 // RUN: %clang_cc1 -verify %s -pedantic-errors -DSTATIC
4 // RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11 -DCONSTEXPR
5 // RUN: %clang_cc1 -verify %s -std=c++11 -DDELETED
6
7 #if INLINE
8 inline // expected-error {{'main' is not allowed to be declared inline}}
9 #elif STATIC
10 static // expected-error {{'main' is not allowed to be declared static}}
11 #elif CONSTEXPR
12 constexpr // expected-error {{'main' is not allowed to be declared constexpr}}
13 #endif
14 int main(int argc, char **argv)
15 #if DELETED
16 = delete; // expected-error {{'main' is not allowed to be deleted}}
17 #else
18 {
19 int (*pmain)(int, char**) = &main; // expected-error {{referring to 'main' within an expression is a Clang extension}}
20
21 if (argc)
22 main(0, 0); // expected-error {{referring to 'main' within an expression is a Clang extension}}
23 }
24 #endif