[clang patch] PR20146

Nathan Sidwell nathan at acm.org
Sun Dec 14 17:37:41 PST 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20146.patch
Type: text/x-patch
Size: 2544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141214/33b4f3b7/attachment.bin>


More information about the cfe-commits mailing list