[clang patch] PR20146

Richard Smith richard at metafoo.co.uk
Tue Jan 13 16:30:23 PST 2015


+    D.getFunctionDefinitionKind () == FDK_Definition) {
+  // [6.9.1/3] qualified void return is invalid on a C

Please remove the extra space before () here. Otherwise, LGTM, thanks!

On Sun, Dec 14, 2014 at 5:37 PM, Nathan Sidwell <nathan at acm.org> wrote:

> This patch fixes a really pedantic error reported as 20146
> http://llvm.org/bugs/show_bug.cgi?id=20146
>
> Apparently in C a void function definition cannot use a qualified void
> return.type.  c99 [6.9.1]/3 says:
>
>  The return type of a function shall be void or an object type other than
>> array type.
>>
>
> There appears no such restriction on a function declaration. (6.9.1 is
> explicitly about a function definition)
>
> C++ appears explicitly bless it in c++ 03 [6.6.3]/3 says:
>
>  A return statement with an expression of type “cv void” can be
>>
> > used only in functions with a return type of cv void; the expression
> > is evaluated just before the function returns to its caller.
>
>
> OK?
>
> nathan
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150113/818ea92a/attachment.html>


More information about the cfe-commits mailing list