4
struct Thing {
  std::string something;
};

Clang-tidy complains:
warning: an exception may be thrown in function 'Thing' which should not throw exceptions [bugprone-exception-escape]

I know about the bugprone-exception-escape.FunctionsThatShouldNotThrow setting, but I could not figure out what to put there to suppress that warning for all structures that contain strings.

Any suggestions?

Alex O
  • 1,429
  • 2
  • 13
  • 20
  • If, based on that link, you can suggest a setting that will suppress only the false positives for that message, by all means post it as an answer. – Alex O Oct 28 '22 at 21:28

1 Answers1

6

It is a bug in the check, see https://github.com/llvm/llvm-project/issues/54668, apparently introduced with LLVM 14. Going by the issue description there isn't really much you can do except suppressing it individually for each class.

If that is too much work, you might want to consider disabling the check until they have fixed this. According to the linked issue a fix is already under review: https://reviews.llvm.org/D134588

user17732522
  • 53,019
  • 2
  • 56
  • 105