From 173a4f43a911175643bda81ee675e8d9269056ea Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957 --- test/CXX/basic/basic.start/basic.start.init/p3.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/CXX/basic/basic.start/basic.start.init/p3.cpp (limited to 'test/CXX/basic/basic.start/basic.start.init/p3.cpp') 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 0000000..506232e --- /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 -- cgit v1.1