[PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 14 16:49:25 PDT 2015
rsmith added inline comments.
================
Comment at: include/clang/Sema/DeclSpec.h:1262
@@ -1260,1 +1261,3 @@
+ /// \brief The end location of the exception specifier, if any.
+ unsigned ExceptionSpecLocEnd;
----------------
nwilson wrote:
> Please let me know if there is still an issue with the wording here.
It'd be better to use "specification" rather than "specifier" here to match the standard.
================
Comment at: lib/Sema/SemaDecl.cpp:7453-7455
@@ +7452,5 @@
+ Range = D.getFunctionTypeInfo().getExceptionSpecRange();
+ Diag(Range.getBegin(), diag::err_function_concept_exception_spec)
+ << FixItHint::CreateRemoval(Range);
+ NewFD->setInvalidDecl();
+ }
----------------
Move this code out of the `if`; we should issue an error whether or not the function was spelled with a function declarator.
================
Comment at: test/SemaCXX/cxx-concept-declaration.cpp:9
@@ -8,1 +8,3 @@
+template<typename T> concept bool C3() { return (throw, 0, true); }
+static_assert(noexcept(C3<int>()), "function concept should be treated as if noexcept(true) specified");
----------------
I guess this should be either `throw 0, true` or `throw, true`.
http://reviews.llvm.org/D11789
More information about the cfe-commits
mailing list