[PATCH] D28258: [Sema] Handle invalid noexcept expressions correctly.

don hinton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 20:59:09 PST 2017


hintonda updated this revision to Diff 83000.
hintonda added a comment.

Rollback previous change and instead only call
actOnDelayedExceptionSpecification if noexcept type is not EST_None.


https://reviews.llvm.org/D28258

Files:
  lib/Parse/ParseCXXInlineMethods.cpp


Index: lib/Parse/ParseCXXInlineMethods.cpp
===================================================================
--- lib/Parse/ParseCXXInlineMethods.cpp
+++ lib/Parse/ParseCXXInlineMethods.cpp
@@ -442,13 +442,15 @@
     if (Tok.isNot(tok::eof) || Tok.getEofData() != LM.Method)
       Diag(Tok.getLocation(), diag::err_except_spec_unparsed);
 
-    // Attach the exception-specification to the method.
-    Actions.actOnDelayedExceptionSpecification(LM.Method, EST,
-                                               SpecificationRange,
-                                               DynamicExceptions,
-                                               DynamicExceptionRanges,
-                                               NoexceptExpr.isUsable()?
-                                                 NoexceptExpr.get() : nullptr);
+    if (EST != EST_None) {
+      // Attach the exception-specification to the method.
+      Actions.actOnDelayedExceptionSpecification(LM.Method, EST,
+                                                 SpecificationRange,
+                                                 DynamicExceptions,
+                                                 DynamicExceptionRanges,
+                                                 NoexceptExpr.isUsable()?
+                                                   NoexceptExpr.get() : nullptr);
+    }
 
     // There could be leftover tokens (e.g. because of an error).
     // Skip through until we reach the original token position.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28258.83000.patch
Type: text/x-patch
Size: 1491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170104/a4716dd3/attachment.bin>


More information about the cfe-commits mailing list