On Fri, Jan 31, 2020 at 02:15:42PM +0900, Kyotaro Horiguchi wrote:
> As a cross check, it cleanly applied and worked as expected. The
> fallback definition of StaticAssertDecl for C worked for gcc 8.3.
Thanks for the review.
> - * Macros to support compile-time assertion checks.
> + * Macros to support compile-time and declaration assertion checks.
>
> All the StaticAssert things check compile-time assertion. I think
> that the name StaticAssertDecl doesn't mean "declaration assertion",
> but means "static assertion as a declaration". Is the change needed?
Hmm. Yeah, that sounds right.
> - * If the "condition" (a compile-time-constant expression) evaluates to false,
> - * throw a compile error using the "errmessage" (a string literal).
> + * If the "condition" (a compile-time-constant or declaration expression)
> + * evaluates to false, throw a compile error using the "errmessage" (a
> + * string literal).
>
> I'm not sure what the "declaration expression" here means. I think
> the term generally means "a variable declaration in expressions",
> something like "r = y * (int x = blah)". In that sense, the parameter
> for StaticAssertDecl is just a compile-time constant expression. Is it
> a right rewrite?
Actually, thinking more about it, I'd rather remove this part as well,
keeping only the change in the third paragraph of this comment block.
--
Michael