From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70FAB385DC14; Sun, 3 May 2020 15:02:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70FAB385DC14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588518157; bh=U/KJP4WTR8ye86nMLU3QJ50JtLp4bXjp52HYiSZxn7g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=k7DCnZVw/TCLEiiVlmAQHVqyUNij6ST1sZJeIXB30X3GWsNNMU8cTqhmIfrcwaZgY gGy1QjkMOqQ5H5X0l6SgOzxFqbQjXjtPxWOyk/F0jSfRD7JIUL1FNmA5WH4sMPORbr MsYXToumIfyAvWVkCugQr/unzCOvc8lyJebfwZCw= From: "asolokha at gmx dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94905] Bogus warning -Werror=maybe-uninitialized Date: Sun, 03 May 2020 15:02:37 +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: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: asolokha at gmx dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2020 15:02:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94905 Arseny Solokha changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |asolokha at gmx dot com --- Comment #3 from Arseny Solokha --- The best I've been able to come up with is the following, reduced from APL = 1.8: enum { MAX_RANK =3D 8 }; struct Shape { Shape(int len) { rho[0] =3D len; } Shape(Shape &other) { for (int r =3D 0; r < MAX_RANK; ++r) rho[r] =3D other.rho[r]; } Shape insert_axis() const; int rho[MAX_RANK]; }; int insert_axis_len; Shape Shape::insert_axis() const { { Shape ret(insert_axis_len); return ret; } } % g++-10.1.0 -O2 -Wall -Werror -c fojcdnsn.cc fojcdnsn.cc: In member function 'Shape Shape::insert_axis() const': fojcdnsn.cc:8:27: error: ''target_mem_ref' not supported by dump_expr' may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] 8 | rho[r] =3D other.rho[r]; | ~~~~~~~~~~~^ That's with gcc-10.1.0-RC-20200430; I failed to reproduce it at all with gc= c 9. However, without preprocessed source provided by the reporter it's impossib= le to tell whether that's the issue in question. So please, provide a self-contained testcase! It's not even necessary to minimize it, as in many cases it's easy to do with tools like C-Reduce or n= ewly emerged C-Vise and can later be done by developers themselves. But without = the testcase developers cannot and likely won't do anything about the issue you have in the first place.=