Index: lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp +++ lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp @@ -147,6 +147,8 @@ PathDiagnosticLocation DL; SourceLocation SL; if (const Stmt *S = getUnreachableStmt(CB)) { + if (S->getLocStart().isMacroID()) + continue; SR = S->getSourceRange(); DL = PathDiagnosticLocation::createBegin(S, B.getSourceManager(), LC); SL = DL.asLocation(); Index: test/Analysis/unreachable-code-path.c =================================================================== --- test/Analysis/unreachable-code-path.c +++ test/Analysis/unreachable-code-path.c @@ -206,3 +206,10 @@ int x = inlineFunction(i); x && x < 10; // no-warning } + +// Don't warn in a macro +#define RETURN(X) do { return; } while (0) +void macro(void) { + RETURN(1); // no-warning +} +