From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70C333857015; Wed, 15 Jul 2020 20:56:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70C333857015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594846607; bh=A5NGUrNIyQMOhJSmkbOMd7BR6JuBpxb5AHCJfxjNO6k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BjH1L/ONOn3gMGHkg85hEHvnzHrQOhHh896v8s1EUWHWZlEJKi0011N0zahlG1N5g xm2Gihtu8tAl6Jyht8w+o9eCxABKotB1S/O0EfvIwpPAEy92+xLmWwh6Gz4RMWLgRb S7MTXaR0e2gvoKzf/o1Mtwo1vQQe4FIJ+ufq5gAw= From: "slyfox at inbox dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95942] [11 regression] offsetof on an array: error: 'e' is not a constant expression Date: Wed, 15 Jul 2020 20:56:47 +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: 10.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at inbox dot ru X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Wed, 15 Jul 2020 20:56:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95942 --- Comment #3 from Sergei Trofimovich --- Another example is edb-debugger project https://github.com/eteran/edb-debugger/blob/070d0196227a58ce2ba15c695944ba1= 6ce66c080/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.c= pp#L331: long PlatformThread::setDebugRegister(std::size_t n, unsigned long value)= { return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user, u_debugreg[n]), value); } Fails build on gcc-11 as: =20 edb-debugger/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThrea= d.cpp:331:72: error: 'n' is not a constant expression 331 | return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user, u_debugreg[n]), value); | ^=