------- Comment #8 from dgregor at gcc dot gnu dot org  2008-08-01 11:55 -------
Thanks Jakub, Dodji for working on this. Some comments:

Some nits:

  - the error message we give in this case is pretty poor. Here we have an
empty initializer, but the error message we get back is "void value not ignored
as it ought to be", which really doesn't tell us much of anything about the
problem. The real issue here is that the statement expression has no return
value, so we should say as such. This same problem can occur with non-empty
statement expressions whose last statement does not produce a value, right? We
should test this case, too.

  - since the statement-expression is obviously empty, can we produce this
error message at template definition time, rather than waiting until
instantiation time? (If the answer isn't a quick "yes", don't worry about it;
I'll eventually be going through the initialization bits to check more of them
at template definition time anyway.)

  - is_pack_expansion_node_p is a pretty general name for a function that is
specific to initializer lists (in general, a TREE_LIST with a pack expansion in
its TREE_VALUE isn't necessarily an "expansion node"). I suggest calling this
"initializer_is_pack_expansion_p".

  - Please put some braces inside the if (init && !t) block. Omitting the
braces for "then" and "else" is okay for small one-liner bodies, but shouldn't
be done when there are if-elses nested inside.

  - parse/empty-statement.C is a strange place to put this check, which deals
with template instantiation. Perhaps call it template/empty-init-statement.C?

  - In the top of the testcase, "PR c++/P36408" should be "PR c++/36408"


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36408

Reply via email to