aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-21 20:51:03 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-21 20:51:03 +0000
commit46b926f0ba31e0e6d108bc655c3166640ebdc327 (patch)
tree765061121d3dc24ba7155a22889049683b9ce6c6 /gcc/cp/semantics.c
parentfc71eeabb012b5ea9e76de5ceb05d7b7529f299b (diff)
PR c++/50308 - wrong deprecated warning with ADL
PR c++/17729 - duplicate deprecated warning * semantics.c (finish_id_expression): Only call mark_used on a function if we aren't building a call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 6a47476b336..6ba7c13d6ec 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3743,7 +3743,15 @@ finish_id_expression (tree id_expression,
if (TREE_CODE (first_fn) == TEMPLATE_DECL)
first_fn = DECL_TEMPLATE_RESULT (first_fn);
- if (!really_overloaded_fn (decl)
+ /* [basic.def.odr]: "A function whose name appears as a
+ potentially-evaluated expression is odr-used if it is the unique
+ lookup result".
+
+ But only mark it if it's a complete postfix-expression; in a call,
+ ADL might select a different function, and we'll call mark_used in
+ build_over_call. */
+ if (done
+ && !really_overloaded_fn (decl)
&& !mark_used (first_fn))
return error_mark_node;