diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index cbe4bd9b070..824e8bf5aa0 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11932,22 +11932,6 @@ type_dependent_expression_p (tree expression) return dependent_type_p (type); } - if (TREE_CODE (expression) == SCOPE_REF - && dependent_scope_ref_p (expression, - type_dependent_expression_p)) - return true; - - if (TREE_CODE (expression) == FUNCTION_DECL - && DECL_LANG_SPECIFIC (expression) - && DECL_TEMPLATE_INFO (expression) - && (any_dependent_template_arguments_p - (INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (expression))))) - return true; - - if (TREE_CODE (expression) == TEMPLATE_DECL - && !DECL_TEMPLATE_TEMPLATE_PARM_P (expression)) - return false; - if (TREE_TYPE (expression) == unknown_type_node) { if (TREE_CODE (expression) == ADDR_EXPR) @@ -11961,7 +11945,9 @@ type_dependent_expression_p (tree expression) if (TREE_CODE (expression) == IDENTIFIER_NODE) return false; } - + if (TREE_CODE (expression) == SCOPE_REF) + return false; + if (TREE_CODE (expression) == BASELINK) expression = BASELINK_FUNCTIONS (expression); if (TREE_CODE (expression) == TEMPLATE_ID_EXPR) @@ -11984,6 +11970,22 @@ type_dependent_expression_p (tree expression) abort (); } + if (TREE_CODE (expression) == SCOPE_REF + && dependent_scope_ref_p (expression, + type_dependent_expression_p)) + return true; + + if (TREE_CODE (expression) == FUNCTION_DECL + && DECL_LANG_SPECIFIC (expression) + && DECL_TEMPLATE_INFO (expression) + && (any_dependent_template_arguments_p + (INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (expression))))) + return true; + + if (TREE_CODE (expression) == TEMPLATE_DECL + && !DECL_TEMPLATE_TEMPLATE_PARM_P (expression)) + return false; + return (dependent_type_p (TREE_TYPE (expression))); } |