From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15993 invoked by alias); 18 Sep 2014 10:12:35 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 15504 invoked by uid 48); 18 Sep 2014 10:12:29 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61465] Bogus parameter set but not used warning in constructor initialization list Date: Thu, 18 Sep 2014 10:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg01824.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61465 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- For: struct Foo { Foo(void* x) : y{static_cast(x)} {} char* y; }; struct Bar { Bar(void* x) : y(static_cast(x)) {} char* y; }; the x parameter in Bar ctor is marked through: #0 mark_exp_read (exp=) at ../../gcc/cp/expr.c:135 #1 0x000000000067af84 in mark_exp_read (exp=) at ../../gcc/cp/expr.c:146 #2 0x000000000067aea6 in mark_rvalue_use (expr=) at ../../gcc/cp/expr.c:99 #3 0x0000000000623e29 in convert_like_real (convs=0x20d65a0, expr=, fn=, argnum=0, inner=0, issue_conversion_warnings=true, c_cast_p=false, complain=3) at ../../gcc/cp/call.c:6209 #4 0x0000000000630bd3 in perform_implicit_conversion_flags (type=, expr=, complain=3, flags=1) at ../../gcc/cp/call.c:9315 #5 0x00000000007bb105 in convert_for_assignment (type=, rhs=, errtype=ICR_INIT, fndecl=, parmnum=0, complain=3, flags=1) at ../../gcc/cp/typeck.c:8233 #6 0x00000000007bb65f in convert_for_initialization (exp=, type=, rhs=, flags=1, errtype=ICR_INIT, fndecl=, parmnum=0, complain=3) at ../../gcc/cp/typeck.c:8324 #7 0x00000000007b933d in cp_build_modify_expr (lhs=, modifycode=INIT_EXPR, rhs=, complain=3) at ../../gcc/cp/typeck.c:7593 #8 0x00000000007ced80 in perform_member_init (member=, init=) at ../../gcc/cp/init.c:771 #9 0x00000000007d0535 in emit_mem_initializers (mem_inits=) at ../../gcc/cp/init.c:1136 #10 0x00000000007f895c in finish_mem_initializers (mem_inits=) at ../../gcc/cp/semantics.c:1603 #11 0x0000000000767fa0 in cp_parser_mem_initializer_list (parser=0x7ffff19fe000) at ../../gcc/cp/parser.c:12530 #12 0x0000000000767b21 in cp_parser_ctor_initializer_opt (parser=0x7ffff19fe000) at ../../gcc/cp/parser.c:12441 #13 0x000000000077311c in cp_parser_ctor_initializer_opt_and_function_body (parser=0x7ffff19fe000, in_function_try_block=false) at ../../gcc/cp/parser.c:18993 #14 0x000000000077adce in cp_parser_function_definition_after_declarator (parser=0x7ffff19fe000, inline_p=true) at ../../gcc/cp/parser.c:23173 #15 0x000000000077cc6a in cp_parser_late_parsing_for_member (parser=0x7ffff19fe000, member_function=) at ../../gcc/cp/parser.c:23856 No idea what different code path is used for the {} initialization as opposed to (), but supposedly somewhere in there we should call mark_rvalue_use or mark_exp_read.