[cfe-dev] 'const void' is considered to be an incomplete type by clang 3.5.0

Hal Finkel hfinkel at anl.gov
Mon Apr 21 12:21:36 PDT 2014


----- Original Message -----
> From: "Yuri" <yuri at rawbw.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: cfe-dev at cs.uiuc.edu
> Sent: Monday, April 21, 2014 2:16:16 PM
> Subject: Re: [cfe-dev] 'const void' is considered to be an incomplete type by	clang 3.5.0
> 
> On 04/21/2014 12:07, Hal Finkel wrote:
> > What do you mean? As I understand it, void is always incomplete.
> > What do you expect sizeof(const void) to return?
> 
> 'incomplete' implies that it can be completed, and 'const void' can't
> be
> completed.

Perhaps, but 'incomplete' here is the correct technical term. 3.9.1 says, "The void type is an incomplete type that cannot be completed.".

> So there are two different situations and this message
> doesn't differentiate between them.
> The message should say "can't apply 'sizeof' to 'const void'" to be
> more
> clear.
> 
> Curiously, clang-3.3 thought that sizeof(const void) is 1.

Interesting.

 -Hal

> 
> Yuri
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list