[PATCH] D67590: Properly ignore mismatched exception specifiers in MSVC Compat mode.

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 16 11:43:39 PDT 2019


rnk added inline comments.


================
Comment at: lib/Sema/SemaDecl.cpp:3565-3572
+    if (OldQTypeForComparison == NewQType ||
+        // In Microsoft compatibility mode, the intent is to only warn on
+        // mismatched exception specifiers.  By this point, that warning has
+        // already been issued, so we should treat mismatches only in exception
+        // specifier as equivalent.
+        (getLangOpts().MSVCCompat &&
+         Context.hasSameFunctionTypeIgnoringExceptionSpec(OldQTypeForComparison,
----------------
I wonder if we should simplify this to just call `hasSameFunctionTypeIgnoringExceptionSpec` in all modes. Essentially, just trust that CheckExceptionSpecification did the right thing, in case it returns false for other reasons in the future. It might actually be better for error recovery, for example, to continue adding this overload when exception specifications don't match. I'll try that and see if it passes tests.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67590/new/

https://reviews.llvm.org/D67590





More information about the cfe-commits mailing list