Commit d09b76f1 by Jason Merrill Committed by Jason Merrill

parser.c (lookup_literal_operator): Correct parm/arg naming mixup.

	* parser.c (lookup_literal_operator): Correct parm/arg naming
	mixup.

From-SVN: r196725
parent 011ce3f3
2013-03-16 Jason Merrill <jason@redhat.com> 2013-03-16 Jason Merrill <jason@redhat.com>
* parser.c (lookup_literal_operator): Correct parm/arg naming
mixup.
PR c++/56238 PR c++/56238
* pt.c (fold_non_dependent_expr_sfinae): Check * pt.c (fold_non_dependent_expr_sfinae): Check
instantiation_dependent_expression_p. instantiation_dependent_expression_p.
......
...@@ -3559,21 +3559,20 @@ lookup_literal_operator (tree name, vec<tree, va_gc> *args) ...@@ -3559,21 +3559,20 @@ lookup_literal_operator (tree name, vec<tree, va_gc> *args)
unsigned int ix; unsigned int ix;
bool found = true; bool found = true;
tree fn = OVL_CURRENT (fns); tree fn = OVL_CURRENT (fns);
tree argtypes = NULL_TREE; tree parmtypes = TYPE_ARG_TYPES (TREE_TYPE (fn));
argtypes = TYPE_ARG_TYPES (TREE_TYPE (fn)); if (parmtypes != NULL_TREE)
if (argtypes != NULL_TREE)
{ {
for (ix = 0; ix < vec_safe_length (args) && argtypes != NULL_TREE; for (ix = 0; ix < vec_safe_length (args) && parmtypes != NULL_TREE;
++ix, argtypes = TREE_CHAIN (argtypes)) ++ix, parmtypes = TREE_CHAIN (parmtypes))
{ {
tree targ = TREE_VALUE (argtypes); tree tparm = TREE_VALUE (parmtypes);
tree tparm = TREE_TYPE ((*args)[ix]); tree targ = TREE_TYPE ((*args)[ix]);
bool ptr = TREE_CODE (targ) == POINTER_TYPE; bool ptr = TREE_CODE (tparm) == POINTER_TYPE;
bool arr = TREE_CODE (tparm) == ARRAY_TYPE; bool arr = TREE_CODE (targ) == ARRAY_TYPE;
if ((ptr || arr || !same_type_p (targ, tparm)) if ((ptr || arr || !same_type_p (tparm, targ))
&& (!ptr || !arr && (!ptr || !arr
|| !same_type_p (TREE_TYPE (targ), || !same_type_p (TREE_TYPE (tparm),
TREE_TYPE (tparm)))) TREE_TYPE (targ))))
found = false; found = false;
} }
if (found if (found
...@@ -3582,7 +3581,7 @@ lookup_literal_operator (tree name, vec<tree, va_gc> *args) ...@@ -3582,7 +3581,7 @@ lookup_literal_operator (tree name, vec<tree, va_gc> *args)
depending on how exactly should user-defined literals depending on how exactly should user-defined literals
work in presence of default arguments on the literal work in presence of default arguments on the literal
operator parameters. */ operator parameters. */
&& argtypes == void_list_node) && parmtypes == void_list_node)
return fn; return fn;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment