Fixes PR#52435.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang-tools-extra/test/clang-tidy/checkers/bugprone-exception-escape.cpp | ||
|---|---|---|
| 291–293 | I think this needs additional test coverage. Dynamic exception specifications: struct super_throws_again {
  super_throws_again() throw(int);
};
struct sub_throws_again : super_throws_again {
  sub_throws_again() noexcept : super_throws_again() {}
};Non-base class explicit inits: struct init_member_throws {
  super_throws s;
  init_member_throws() noexcept : s() {}
};Non-base class implicit inits: struct init_member_throws {
  super_throws s;
  init_member_throws() noexcept {}
};In-class initializers (IIRC those are modeled as a ctor init): struct init {
  explicit init(int, int) noexcept(false);
};
struct in_class_init_throws {
  init i{1, 2};
};I *think* all of these will wind up being covered by the code changes, but we should test them to be sure. | |
| clang-tools-extra/test/clang-tidy/checkers/bugprone-exception-escape.cpp | ||
|---|---|---|
| 291–293 | Thanks a lot for your suggestions! I have added these tests, as well as some special handling for CXXDefaultInitExpr, which was necessary to get the last one to pass. | |
I think this needs additional test coverage.
Dynamic exception specifications:
struct super_throws_again { super_throws_again() throw(int); }; struct sub_throws_again : super_throws_again { sub_throws_again() noexcept : super_throws_again() {} };Non-base class explicit inits:
struct init_member_throws { super_throws s; init_member_throws() noexcept : s() {} };Non-base class implicit inits:
struct init_member_throws { super_throws s; init_member_throws() noexcept {} };In-class initializers (IIRC those are modeled as a ctor init):
struct init { explicit init(int, int) noexcept(false); }; struct in_class_init_throws { init i{1, 2}; };I *think* all of these will wind up being covered by the code changes, but we should test them to be sure.