From d09b76f1533e68693677cd41527761e8cfafe49f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 16 Mar 2013 22:34:20 -0400 Subject: [PATCH] parser.c (lookup_literal_operator): Correct parm/arg naming mixup. * parser.c (lookup_literal_operator): Correct parm/arg naming mixup. From-SVN: r196725 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/parser.c | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fa17a08..14bab43 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2013-03-16 Jason Merrill + * parser.c (lookup_literal_operator): Correct parm/arg naming + mixup. + PR c++/56238 * pt.c (fold_non_dependent_expr_sfinae): Check instantiation_dependent_expression_p. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ff4faa3..12926e3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3559,21 +3559,20 @@ lookup_literal_operator (tree name, vec *args) unsigned int ix; bool found = true; tree fn = OVL_CURRENT (fns); - tree argtypes = NULL_TREE; - argtypes = TYPE_ARG_TYPES (TREE_TYPE (fn)); - if (argtypes != NULL_TREE) + tree parmtypes = TYPE_ARG_TYPES (TREE_TYPE (fn)); + if (parmtypes != NULL_TREE) { - for (ix = 0; ix < vec_safe_length (args) && argtypes != NULL_TREE; - ++ix, argtypes = TREE_CHAIN (argtypes)) + for (ix = 0; ix < vec_safe_length (args) && parmtypes != NULL_TREE; + ++ix, parmtypes = TREE_CHAIN (parmtypes)) { - tree targ = TREE_VALUE (argtypes); - tree tparm = TREE_TYPE ((*args)[ix]); - bool ptr = TREE_CODE (targ) == POINTER_TYPE; - bool arr = TREE_CODE (tparm) == ARRAY_TYPE; - if ((ptr || arr || !same_type_p (targ, tparm)) + tree tparm = TREE_VALUE (parmtypes); + tree targ = TREE_TYPE ((*args)[ix]); + bool ptr = TREE_CODE (tparm) == POINTER_TYPE; + bool arr = TREE_CODE (targ) == ARRAY_TYPE; + if ((ptr || arr || !same_type_p (tparm, targ)) && (!ptr || !arr - || !same_type_p (TREE_TYPE (targ), - TREE_TYPE (tparm)))) + || !same_type_p (TREE_TYPE (tparm), + TREE_TYPE (targ)))) found = false; } if (found @@ -3582,7 +3581,7 @@ lookup_literal_operator (tree name, vec *args) depending on how exactly should user-defined literals work in presence of default arguments on the literal operator parameters. */ - && argtypes == void_list_node) + && parmtypes == void_list_node) return fn; } } -- 2.7.4