diff options
author | Jason Merrill <jason@redhat.com> | 2012-07-02 15:14:23 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-07-02 15:14:23 -0400 |
commit | 8d0d1915d9f96a4c9d9418b21b38cfa9c386d7a3 (patch) | |
tree | 8becd43c0137d4c13ec1df45fe08c64cceb0a023 /gcc/cp/tree.c | |
parent | 531b10fcb0fe5c86576bda5fd201d8acc7db4525 (diff) | |
download | gcc-8d0d1915d9f96a4c9d9418b21b38cfa9c386d7a3.zip gcc-8d0d1915d9f96a4c9d9418b21b38cfa9c386d7a3.tar.gz gcc-8d0d1915d9f96a4c9d9418b21b38cfa9c386d7a3.tar.bz2 |
re PR c++/53524 (Bogus enum comparison warning)
PR c++/53524
gcc/cp/
* call.c (build_conditional_expr_1): Don't warn about comparison of
two enumerators before their enumeration is complete.
(build_new_op_1): Call decay_conversion before warn_logical_operator.
* decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
its enumeration.
* decl2.c (mark_used): Call used_types_insert for enums.
* semantics.c (finish_id_expression): Don't decay CONST_DECL.
(finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
* class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
* typeck.c (convert_for_assignment): Don't decay CONST_DECL.
(build_class_member_access_expr): Look through unscoped enums.
* search.c (context_for_name_lookup): Look through unscoped enums.
* pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
(tsubst_copy): Use DECL_CONTEXT to find the enumeration.
* tree.c (decl_linkage): Likewise.
* cvt.c (ocp_convert): Check decayed expr for enum range warning.
gcc/c-family/
* c-common.c (get_priority): Call default_conversion.
From-SVN: r189174
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2b541cd..a03f845 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3212,7 +3212,7 @@ decl_linkage (tree decl) /* Linkage of a CONST_DECL depends on the linkage of the enumeration type. */ if (TREE_CODE (decl) == CONST_DECL) - return decl_linkage (TYPE_NAME (TREE_TYPE (decl))); + return decl_linkage (TYPE_NAME (DECL_CONTEXT (decl))); /* Some things that are not TREE_PUBLIC have external linkage, too. For example, on targets that don't have weak symbols, we make all |