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++/50308] __attribute__((deprecated)) incorrectly generates warning in ADL lookup


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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> 2012-02-01 17:57:04 UTC ---
the warning is generated from:
 /GCC/gcc-live-trunk/gcc/cp/semantics.c:3342

the decl is unused on entry to finish_id_expression () ..
.. and marked as used (on line 3306) ... is that expected?

Otherwise, I'd assume that we could guard  line 3342 with say...
  if (TREE_USED (decl) && TREE_DEPRECATED (decl))
    warn_deprecated_use (decl, NULL_TREE);

dunno..
===

(gdb) call debug_tree(node)
 <function_decl 0x421d7800 A
    type <function_type 0x42129f00
        type <void_type 0x4211a720 void VOID
            align 8 symtab 0 alias set -1 canonical type 0x4211a720
            pointer_to_this <pointer_type 0x4211a780>>
        QI
        size <integer_cst 0x4210478c constant 8>
        unit size <integer_cst 0x421047a8 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x42129f00
        arg-types <tree_list 0x42114588 value <integer_type 0x4211a3c0 int>
            chain <tree_list 0x42114150 value <void_type 0x4211a720 void>>>>
    used public deprecated external QI file ../tests-attr/pr50308-1.C line 1
col 6 align 8 context <translation_unit_decl 0x4211c06c D.1>
    arguments <parm_decl 0x4210e8dc D.2180
        type <integer_type 0x4211a3c0 int public SI
            size <integer_cst 0x421045cc constant 32>
            unit size <integer_cst 0x421045e8 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x4211a3c0 precision
32 min <integer_cst 0x421048c0 -2147483648> max <integer_cst 0x421048dc
2147483647>
            pointer_to_this <pointer_type 0x4211aae0>>
        SI file ../tests-attr/pr50308-1.C line 1 col 9 size <integer_cst
0x421045cc 32> unit size <integer_cst 0x421045e8 4>
        align 32 context <function_decl 0x421d7800 A>
        arg-type <integer_type 0x4211a3c0 int>>
    full-name "void A(int)"
    chain <function_decl 0x421cee80 __cxa_call_unexpected>>


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