[PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

don hinton via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 08:02:54 PDT 2016


hintonda added inline comments.

================
Comment at: clang-tidy/modernize/UseNoexceptCheck.h:44-45
@@ +43,4 @@
+                   unsigned &Len);
+  const std::string ReplacementStr;
+  StringRef Replacement;
+};
----------------
aaron.ballman wrote:
> What is the difference between these two fields? The names are kind of confusing to me given their similarity, so perhaps renaming one to be more descriptive would be useful.
The first is the option passed in, i.e., the replacement string we will use (either noexcept or a user macro like libcxx's _NOEXCEPT) for throw() and the second one is the string we'll actually use for a particular replacement, which can be what the user supplied, or noexcept(false) when the function can throw.

This was originally done with an auto in check(), but Alex wanted me to add a helper function to make check() easier to understand.  So, I had to put it somewhere.  I actually prefer the simpler original version.

I'll see if I can come up with better names, but suggestions are always welcome.


http://reviews.llvm.org/D18575





More information about the cfe-commits mailing list