This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH C/C++] Fix some diagnostics problems
- From: Shujing Zhao <pearly dot zhao at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Joseph <joseph at codesourcery dot com>, Gcc-Patches <gcc-patches at gcc dot gnu dot org>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Wed, 09 Jun 2010 11:04:03 +0800
- Subject: Re: [PATCH C/C++] Fix some diagnostics problems
- References: <4C0DC2B4.3080200@oracle.com> <4C0E94C8.4070807@redhat.com>
On 06/09/2010 03:06 AM, Jason Merrill wrote:
On 06/08/2010 12:10 AM, Shujing Zhao wrote:
* cp-tree.h (expr_list): New type.
Please call this expr_list_kind so people don't think it's a TREE_LIST.
Or don't bother giving it a name and just pass it as an int.
(impl_conv_rhs): New type.
Why is this different in name and capitalization from impl_conv in the C
front end?
There is an implicit conversion string parameter at function "convert_to_void".
It maybe be used as an enumeration to emit the diagnostic messages some day. (I
have a plan to do that, but it hasn't be finished). That enumeration maybe be
named "impl_conv_void" etc. The above one is named "impl_conv_rhs" to
distinguish it from "impl_conv_void".
Naming the capitalization members is to keep consistently with the other
enumeration definition in c++.
......
if (TREE_CODE (decl) == RESULT_DECL)
- init = build_x_compound_expr_from_list (init,
- "return value initializer");
+ init = build_x_compound_expr_from_list (init, EL_RETURN_VAL_INIT);
I believe this code is a relic of the old named return value extension,
and can be removed along with EL_RETURN_VAL_INIT.
Do you mean remove them as the following?
@@ -727,10 +727,7 @@
else if (TREE_CODE (init) == TREE_LIST
&& TREE_TYPE (init) != unknown_type_node)
{
- if (TREE_CODE (decl) == RESULT_DECL)
- init = build_x_compound_expr_from_list (init,
- "return value initializer");
- else if (TREE_CODE (init) == TREE_LIST
+ if (TREE_CODE (init) == TREE_LIST
&& TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
{
error ("cannot initialize arrays using this syntax");
......
Thanks
Pearly