r199783 - Add a test file missed from r199782.

Richard Smith richard-llvm at metafoo.co.uk
Tue Jan 21 18:05:03 PST 2014


Author: rsmith
Date: Tue Jan 21 20:05:03 2014
New Revision: 199783

URL: http://llvm.org/viewvc/llvm-project?rev=199783&view=rev
Log:
Add a test file missed from r199782.

Added:
    cfe/trunk/test/CXX/basic/basic.start/basic.start.init/p3.cpp

Added: cfe/trunk/test/CXX/basic/basic.start/basic.start.init/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/basic/basic.start/basic.start.init/p3.cpp?rev=199783&view=auto
==============================================================================
--- cfe/trunk/test/CXX/basic/basic.start/basic.start.init/p3.cpp (added)
+++ cfe/trunk/test/CXX/basic/basic.start/basic.start.init/p3.cpp Tue Jan 21 20:05:03 2014
@@ -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





More information about the cfe-commits mailing list