summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commitf05c0958e281e89ed1d8cc0752a5878ac9d8ed66 (patch)
treead3d75c2bbdbdbfb747873274c38e2f66dac106e /clang/lib
parent85ef0431a7a7648af053b742afc7eb8f4ebd5adc (diff)
downloadbcm5719-llvm-f05c0958e281e89ed1d8cc0752a5878ac9d8ed66.tar.gz
bcm5719-llvm-f05c0958e281e89ed1d8cc0752a5878ac9d8ed66.zip
Remove the Fix-It for "main must return 'int'", which is not always
correct and is not worth fixing. Fixes PR8396. llvm-svn: 126035
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 95ab5fadd5a..679b430a3cf 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud