This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH C/C++] Fix some diagnostics problems


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]