This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53524] [4.7/4.8 Regression] Bogus enum comparison warning


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53524

--- Comment #27 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-02 19:14:29 UTC ---
Author: jason
Date: Mon Jul  2 19:14:23 2012
New Revision: 189174

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189174
Log:
    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.

Added:
    trunk/gcc/testsuite/g++.dg/template/enum7.C
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cvt.c
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/search.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/scoped_enum.C
    trunk/gcc/testsuite/g++.dg/other/ptrmem10.C
    trunk/gcc/testsuite/g++.dg/other/ptrmem11.C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]