diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-10-21 16:57:46 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-10-21 16:57:46 +0000 |
| commit | bff62031529e651942326b13596b34fd4d96bac7 (patch) | |
| tree | 45149e7addb1b25b7642c378f250684c058fba20 /clang/test/CXX/basic | |
| parent | 096011eebf38d2c637ccac8906f03773d218b859 (diff) | |
| download | bcm5719-llvm-bff62031529e651942326b13596b34fd4d96bac7.tar.gz bcm5719-llvm-bff62031529e651942326b13596b34fd4d96bac7.zip | |
Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.
Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.
llvm-svn: 117029
Diffstat (limited to 'clang/test/CXX/basic')
| -rw-r--r-- | clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp new file mode 100644 index 00000000000..abf8faa968c --- /dev/null +++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template<typename T> +int main() { } // expected-error{{'main' cannot be a template}} + |

