aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@gcc.gnu.org>2016-01-16 02:37:09 +0000
committerPatrick Palka <ppalka@gcc.gnu.org>2016-01-16 02:37:09 +0000
commitec7886c19b5853d27c37cfb269f70805e4296231 (patch)
treea034319e48216378ff232cd782888a7ce4ebf446 /gcc/cp/pt.c
parent203484bb27d092dde0f91bf50ce6bc541f1e5dfe (diff)
downloadgcc-ec7886c19b5853d27c37cfb269f70805e4296231.zip
gcc-ec7886c19b5853d27c37cfb269f70805e4296231.tar.gz
gcc-ec7886c19b5853d27c37cfb269f70805e4296231.tar.bz2
Fix PR c++/69091 (ICE with operator overload having 'auto' return type)
gcc/cp/ChangeLog: PR c++/69091 * pt.c (type_dependent_expression_p): For a function template specialization, a type is dependent iff any of its template arguments are. gcc/testsuite/ChangeLog: PR c++/69091 * g++.dg/template/pr69091.C: New test. From-SVN: r232463
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index edec774..403c5ac 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -22759,12 +22759,12 @@ type_dependent_expression_p (tree expression)
|| dependent_scope_p (scope));
}
+ /* A function template specialization is type-dependent if it has any
+ dependent template arguments. */
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;
+ && DECL_TEMPLATE_INFO (expression))
+ return any_dependent_template_arguments_p (DECL_TI_ARGS (expression));
if (TREE_CODE (expression) == TEMPLATE_DECL
&& !DECL_TEMPLATE_TEMPLATE_PARM_P (expression))