Index: lib/Sema/AnalysisBasedWarnings.cpp =================================================================== --- lib/Sema/AnalysisBasedWarnings.cpp +++ lib/Sema/AnalysisBasedWarnings.cpp @@ -293,7 +293,7 @@ if (Throw->getSubExpr()) ThrowType = Throw->getSubExpr()->getType().getTypePtrOrNull(); if (!ThrowType) - return false; + return true; const Type *CaughtType = Catch->getCaughtType().getTypePtrOrNull(); if (!CaughtType) return true; Index: test/SemaCXX/warn-throw-out-noexcept-func.cpp =================================================================== --- test/SemaCXX/warn-throw-out-noexcept-func.cpp +++ test/SemaCXX/warn-throw-out-noexcept-func.cpp @@ -239,12 +239,22 @@ } catch (const S &s) { } } -void o_ShouldDiag() noexcept { //expected-note {{function declared non-throwing here}} +// As seen in p34973, this should not throw the warning. If there is an active +// exception, catch(...) catches everything. +void o_ShouldNotDiag() noexcept { try { - throw; //expected-warning {{has a non-throwing exception specification but}} + throw; } catch (...) { } } +// In fact, a rethrow with ANY catch should be trusted here, otherwise it is +// going to result in many false positives. +void p_ShouldNotDiag() noexcept { + try { + throw; + } catch (int){ + } +} #define NOEXCEPT noexcept void with_macro() NOEXCEPT { //expected-note {{function declared non-throwing here}}