diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CXX/basic/basic.start/basic.start.init/p3.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/CXX/basic/basic.start/basic.start.init/p3.cpp')
| -rw-r--r-- | test/CXX/basic/basic.start/basic.start.init/p3.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.start/basic.start.init/p3.cpp b/test/CXX/basic/basic.start/basic.start.init/p3.cpp new file mode 100644 index 000000000000..506232ebacc4 --- /dev/null +++ b/test/CXX/basic/basic.start/basic.start.init/p3.cpp @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -verify %s -pedantic-errors +// RUN: %clang_cc1 -verify %s -pedantic-errors -DINLINE +// RUN: %clang_cc1 -verify %s -pedantic-errors -DSTATIC +// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11 -DCONSTEXPR +// RUN: %clang_cc1 -verify %s -std=c++11 -DDELETED + +#if INLINE +inline // expected-error {{'main' is not allowed to be declared inline}} +#elif STATIC +static // expected-error {{'main' is not allowed to be declared static}} +#elif CONSTEXPR +constexpr // expected-error {{'main' is not allowed to be declared constexpr}} +#endif +int main(int argc, char **argv) +#if DELETED + = delete; // expected-error {{'main' is not allowed to be deleted}} +#else +{ + int (*pmain)(int, char**) = &main; // expected-error {{ISO C++ does not allow 'main' to be used by a program}} + + if (argc) + main(0, 0); // expected-error {{ISO C++ does not allow 'main' to be used by a program}} +} +#endif |
