]> granicus.if.org Git - clang/commitdiff
main() exists in hosted, not freestanding implementations. Fixes the
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Sun, 15 May 2011 20:59:31 +0000 (20:59 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Sun, 15 May 2011 20:59:31 +0000 (20:59 +0000)
build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131390 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index 1e98998002f2de866ab2ae02db9687b4593a0f43..ec11838c84737f64c266e0366a5f710be423fd7d 100644 (file)
@@ -1478,7 +1478,7 @@ bool FunctionDecl::isMain() const {
   const TranslationUnitDecl *tunit =
     dyn_cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext());
   return tunit &&
-         tunit->getASTContext().getLangOptions().Freestanding &&
+         !tunit->getASTContext().getLangOptions().Freestanding &&
          getIdentifier() &&
          getIdentifier()->isStr("main");
 }