aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-19 19:04:23 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-19 19:04:23 +0000
commit5f39f706afeb4d4a6f246db1e8cd2da0fb5b7f37 (patch)
treefde454c52076087981db6b0cf807013e73e70b3e /lib/Sema/SemaDecl.cpp
parent3263e09c8e0925edaa541d0d4bb995b4bfb454e7 (diff)
Remove the Fix-It for "main must return 'int'", which is not always
correct and is not worth fixing. Fixes PR8396. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 95ab5fadd5..679b430a3c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4377,14 +4377,7 @@ void Sema::CheckMain(FunctionDecl* FD) {
const FunctionType* FT = T->getAs<FunctionType>();
if (!Context.hasSameUnqualifiedType(FT->getResultType(), Context.IntTy)) {
- TypeSourceInfo *TSI = FD->getTypeSourceInfo();
- TypeLoc TL = TSI->getTypeLoc().IgnoreParens();
- const SemaDiagnosticBuilder& D = Diag(FD->getTypeSpecStartLoc(),
- diag::err_main_returns_nonint);
- if (FunctionTypeLoc* PTL = dyn_cast<FunctionTypeLoc>(&TL)) {
- D << FixItHint::CreateReplacement(PTL->getResultLoc().getSourceRange(),
- "int");
- }
+ Diag(FD->getTypeSpecStartLoc(), diag::err_main_returns_nonint);
FD->setInvalidDecl(true);
}