aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-04-19 15:30:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-04-19 15:30:22 -0400
commit76f3944041f68df765cef48819936be04227d696 (patch)
treea53f0050a6888ff46d0f97f7d2e01c98f6863e4a /gcc/cp/semantics.c
parent90eeab20f7aec033494f554a7536954b3be63809 (diff)
downloadgcc-76f3944041f68df765cef48819936be04227d696.zip
gcc-76f3944041f68df765cef48819936be04227d696.tar.gz
gcc-76f3944041f68df765cef48819936be04227d696.tar.bz2
PR c++/66543 - -Wunused-but-set* false positives
* expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR. * pt.c (make_pack_expansion): Call mark_exp_read. * semantics.c (finish_id_expression): Call mark_type_use in unevaluated context. From-SVN: r235221
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 56864b4..85ef993 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3487,6 +3487,12 @@ finish_id_expression (tree id_expression,
if (!scope && decl != error_mark_node && identifier_p (id_expression))
maybe_note_name_used_in_class (id_expression, decl);
+ /* A use in unevaluated operand might not be instantiated appropriately
+ if tsubst_copy builds a dummy parm, or if we never instantiate a
+ generic lambda, so mark it now. */
+ if (processing_template_decl && cp_unevaluated_operand)
+ mark_type_use (decl);
+
/* Disallow uses of local variables from containing functions, except
within lambda-expressions. */
if (outer_automatic_var_p (decl))