From 18857f7a1ff88469283b9e87384bdf5c8a274ca6 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 10 Sep 2012 14:54:38 +0000 Subject: [PATCH] Workaround for MacOSX build failure with gcc <= 4.4 Summary: A better solution to http://llvm.org/bugs/show_bug.cgi?id=13777 Named namespace + more unique name to make ODR violations unlikely. Reviewers: chandlerc, doug.gregor, klimek Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D38 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163513 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/clang-check/ClangCheck.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/clang-check/ClangCheck.cpp b/tools/clang-check/ClangCheck.cpp index 1eb369077e..daa593ad5d 100644 --- a/tools/clang-check/ClangCheck.cpp +++ b/tools/clang-check/ClangCheck.cpp @@ -58,10 +58,10 @@ static cl::opt ASTDumpFilter( "ast-dump-filter", cl::desc(Options->getOptionHelpText(options::OPT_ast_dump_filter))); -// Anonymous namespace here causes problems with gcc <= 4.4 on MacOS: -// http://llvm.org/bugs/show_bug.cgi?id=13777 -// namespace { -class ActionFactory { +// Anonymous namespace here causes problems with gcc <= 4.4 on MacOS 10.6. +// "Non-global symbol: ... can't be a weak_definition" +namespace clang_check { +class ClangCheckActionFactory { public: clang::ASTConsumer *newASTConsumer() { if (ASTList) @@ -73,10 +73,10 @@ public: return new clang::ASTConsumer(); } }; -// } +} int main(int argc, const char **argv) { - ActionFactory Factory; + clang_check::ClangCheckActionFactory Factory; CommonOptionsParser OptionsParser(argc, argv); ClangTool Tool(OptionsParser.GetCompilations(), OptionsParser.GetSourcePathList()); -- 2.40.0