From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF6D23858417; Sun, 2 Jul 2023 08:08:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF6D23858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688285332; bh=vDXkCF1q8/uIT3u8MD9FP01aEpvY/QGnwLExV+KRKmw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nb+XTN2Pn/sYWH4h3M2pVMn7DP4Lq1lgYXvvzyJYWII5SfQlqOqep0Q+qTQiELj/r kyFhtBFMX2d7RYnShrzOmmvmXw8dHd+ldt+CbDLUh4B9JNem+cMRdBm0YYLF32RJ5u F4oY+KpoUT+BPacCzbJ2McariJXIgV4nscuj8nHY= From: "daniel-dev at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110497] Wrong error on non-static data member referenced in concept definition Date: Sun, 02 Jul 2023 08:08:51 +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: 13.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel-dev at hotmail dot de 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: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110497 --- Comment #2 from Daniel --- Just some observations: There was a similar discussion in https://stackoverflow.com/questions/75443227/static-assert-on-an-ill-formed= -no-diagnostic-required-expression Note that if we use anything else which leads to the ill-formed expression = for T::b itself, e.g. B&, B*, int - gcc compiles without errors: struct B { const bool b =3D true; }; template concept C =3D T::b; static_assert( !C ); static_assert( !C ); static_assert( !C ); https://gcc.godbolt.org/z/9c6YW1vWe I would expect (at least as a user) the same behaviour for static_assert(!C= ) too, in that case. So gcc seems to consider T::b (with T=3Db) in this context as a well-formed expression, but not a constant expression. Looks strange.=