[PATCH] D11027: [CONCEPTS] Creating Diagnostics for ill-formed function concept declaration

Hubert Tong hubert.reinterpretcast at gmail.com
Thu Jul 16 11:52:47 PDT 2015


On Wed, Jul 15, 2015 at 4:52 PM, Nathan Wilson <nwilson20 at gmail.com> wrote:

> nwilson added inline comments.
>
> ================
> Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1965-1966
> @@ +1964,4 @@
> +  "concept declarations may only appear in namespace scope">;
> +def err_function_concept_not_defined : Error<
> +  "function concept declaration must be a definition">;
> +
> ----------------
> rsmith wrote:
> > Does this not also apply to variable concepts? For instance
> >
> >   template<typename T> extern concept bool b;
>
A variable concept requires an initializer, not just a definition.


> Could we create a separate diagnostic for that?  i.e.:
>
> def err_variable_concept_not_intialized : Error<
>   "variable concept declaration requires initialization">;
>
My preferred message text is:

function concept declaration must be a definition
variable concept declaration must have an initializer

I do not see an advantage to using the same message identifier for the two.
Indeed, doing that might cause difficulties for message translation efforts.


>
>
> http://reviews.llvm.org/D11027
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150716/7476cb52/attachment.html>


More information about the cfe-commits mailing list