diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2013-07-06 02:13:46 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2013-07-06 02:13:46 +0000 |
| commit | 027f9c4026a8da9eb2714ae381f1966459dc9839 (patch) | |
| tree | 741d8b308c982d76f4c423b2b202636949a9aa0d /clang/test/CXX/basic/basic.start | |
| parent | 574d521c85ed1fd00f751bf45cf0648db25dc088 (diff) | |
| download | bcm5719-llvm-027f9c4026a8da9eb2714ae381f1966459dc9839.tar.gz bcm5719-llvm-027f9c4026a8da9eb2714ae381f1966459dc9839.zip | |
Sema: Fix a crash when main is redeclared as a function-template.
This boils down to us sending invalid function decls to
CheckFunctionDeclaration becauswe we did not consider that CheckMain
could cause the decl to be invalid. Instead, interogate the new decl's
main-validity and *then* send it over to get CheckFunctionDeclaration'd
if it was still valid after calling CheckMain.
llvm-svn: 185745
Diffstat (limited to 'clang/test/CXX/basic/basic.start')
| -rw-r--r-- | clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp index a5386f1b925..cd912b834d7 100644 --- a/clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp +++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2.cpp @@ -15,6 +15,8 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST10 // RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST11 // RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST12 +// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST12 +// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST13 #if TEST1 @@ -94,6 +96,13 @@ int main(int, charT* const *) {} typedef char charT; int main(int, const charT* const *) {} +#elif TEST13 + +int main(void) {} + +template <typename T> +int main(void); // expected-error{{'main' cannot be a template}} + #else #error Unknown test mode |

