brintos

brintos / llvm-project-archived public Read only

0
0
Text · 918 B · 6614003 Raw
25 lines · cpp
1// RUN: %clang_cc1 -verify %s -pedantic-errors2// RUN: %clang_cc1 -verify %s -pedantic-errors -DINLINE3// RUN: %clang_cc1 -verify %s -pedantic-errors -DSTATIC4// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11 -DCONSTEXPR5// RUN: %clang_cc1 -verify %s -std=c++11 -DDELETED6 7#if INLINE8inline // expected-error {{'main' is not allowed to be declared inline}}9#elif STATIC10static // expected-error {{'main' is not allowed to be declared static}}11#elif CONSTEXPR12constexpr // expected-error {{'main' is not allowed to be declared constexpr}}13#endif14int main(int argc, char **argv)15#if DELETED16  = delete; // expected-error {{'main' is not allowed to be deleted}}17#else18{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#endif25