================
@@ -483,10 +486,20 @@ ExceptionAnalyzer::ExceptionInfo
ExceptionAnalyzer::throwsException(
}
CallStack.erase(Func);
+ // Optionally treat unannotated functions as potentially throwing if they
+ // are not explicitly non-throwing and no throw was discovered.
+ if (AssumeUnannotatedThrowing &&
+ Result.getBehaviour() == State::NotThrowing && canThrow(Func)) {
+ Result.registerUnknownException();
+ return Result;
+ }
return Result;
}
auto Result = ExceptionInfo::createUnknown();
+ if (MissingDefinitionsAreThrowing)
+ Result.registerUnknownException();
----------------
vbvictor wrote:
I think we should only registern Unknown exception at the end if none were
inserted in loop `for (const QualType &Ex : FPT->exceptions()) {`
because in func-proto we may find exceptions so this part will effectively do
nothing.
I guess logically it should be in the end if nothing else found exceptions
https://github.com/llvm/llvm-project/pull/168324
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits