aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-04-03 17:26:50 +0000
committerJason Merrill <jason@redhat.com>2009-04-03 17:26:50 +0000
commit3103396a4711ffe255525dc8ea7e2264a42aaf3d (patch)
tree41c4d103c3dcb3f914a42a82834b1f0cdd95b92b /gcc/cp/pt.c
parentcb0aca2e83ee12c9f38024fdd53a5f6813dd02e2 (diff)
PR c++/39608
* semantics.c (finish_id_expression): Don't assume a dependent member of the current instantiation isn't a valid integral constant expression. Check dependent_scope_p. * pt.c (dependent_scope_p): Check TYPE_P. (tsubst_copy): If args is null, just return. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch@145509 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c3873cd7ea3..0a45422c8d1 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9961,7 +9961,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
enum tree_code code;
tree r;
- if (t == NULL_TREE || t == error_mark_node)
+ if (t == NULL_TREE || t == error_mark_node || args == NULL_TREE)
return t;
code = TREE_CODE (t);
@@ -16124,7 +16124,8 @@ dependent_type_p (tree type)
bool
dependent_scope_p (tree scope)
{
- return dependent_type_p (scope) && !currently_open_class (scope);
+ return (scope && TYPE_P (scope) && dependent_type_p (scope)
+ && !currently_open_class (scope));
}
/* Returns TRUE if EXPRESSION is dependent, according to CRITERION. */