summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-07-14 14:15:35 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-07-14 14:15:35 -0400
commit4e6a97250c769588c57079976c4299b2814d6310 (patch)
treef913131dcfc39f5179b8168f8020117cb96dc13e /gcc/cp
parentb35c81608887526d18a068f9c84192a7efaf2b25 (diff)
downloadgcc-4e6a97250c769588c57079976c4299b2814d6310.tar.gz
re PR c++/40740 (template-id forgotten with arg-dep lookup)
PR c++/40740 * semantics.c (perform_koenig_lookup): Handle empty template args. From-SVN: r149636
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 812349486ca..67bbc740f6c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/40740
+ * semantics.c (perform_koenig_lookup): Handle empty template args.
+
2009-07-13 Jason Merrill <jason@redhat.com>
* call.c (build_over_call): Use can_trust_pointer_alignment.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index aa52a362fb7..61dff51ba75 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1827,9 +1827,12 @@ perform_koenig_lookup (tree fn, VEC(tree,gc) *args)
tree identifier = NULL_TREE;
tree functions = NULL_TREE;
tree tmpl_args = NULL_TREE;
+ bool template_id = false;
if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
{
+ /* Use a separate flag to handle null args. */
+ template_id = true;
tmpl_args = TREE_OPERAND (fn, 1);
fn = TREE_OPERAND (fn, 0);
}
@@ -1861,8 +1864,8 @@ perform_koenig_lookup (tree fn, VEC(tree,gc) *args)
fn = unqualified_fn_lookup_error (identifier);
}
- if (fn && tmpl_args)
- fn = build_nt (TEMPLATE_ID_EXPR, fn, tmpl_args);
+ if (fn && template_id)
+ fn = build2 (TEMPLATE_ID_EXPR, unknown_type_node, fn, tmpl_args);
return fn;
}