mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 06:56:44 +00:00

Summary: This fixes several issues with the original implementation: - Win32 entry points cannot be in namespaces - A Win32 entry point cannot be a function template, diagnose if we it. - Win32 entry points cannot be overloaded. - Win32 entry points implicitly return, similar to main. Reviewers: rnk, rsmith, whunt, timurrrr Reviewed By: rnk CC: cfe-commits, nrieck Differential Revision: http://llvm-reviews.chandlerc.com/D1683 llvm-svn: 190818
22 lines
606 B
C++
22 lines
606 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -triple i386-pc-win32 %s
|
|
|
|
template <typename T>
|
|
int wmain() { // expected-error{{'wmain' cannot be a template}}
|
|
return 0;
|
|
}
|
|
|
|
namespace {
|
|
int WinMain(void) { return 0; }
|
|
int WinMain(int) { return 0; }
|
|
}
|
|
|
|
void wWinMain(void) {} // expected-note{{previous definition is here}}
|
|
void wWinMain(int) {} // expected-error{{conflicting types for 'wWinMain'}}
|
|
|
|
int foo() {
|
|
wmain<void>(); // expected-error{{no matching function for call to 'wmain'}}
|
|
wmain<int>(); // expected-error{{no matching function for call to 'wmain'}}
|
|
WinMain();
|
|
return 0;
|
|
}
|