]> granicus.if.org Git - clang/commitdiff
Add a test file missed from r199782.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 22 Jan 2014 02:05:03 +0000 (02:05 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 22 Jan 2014 02:05:03 +0000 (02:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199783 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/basic/basic.start/basic.start.init/p3.cpp [new file with mode: 0644]

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 (file)
index 0000000..506232e
--- /dev/null
@@ -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