This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PING] [PATCH] c++/65579 - set readonly bit on static constexpr members of templates
- From: Martin Sebor <msebor at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Wed, 16 Mar 2016 13:43:57 -0600
- Subject: [PING] [PATCH] c++/65579 - set readonly bit on static constexpr members of templates
- Authentication-results: sourceware.org; auth=none
- References: <56E09F18 dot 7030103 at gmail dot com>
I'm looking for a review of the patch below. The problem isn't
new (it has existed since at least 4.9) but the fix seems trivial
and safe. If it isn't appropriate at this stage please let me
know and I'll resubmit it when stage 1 opens.
https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00593.html
Thanks
Martin
On 03/09/2016 03:09 PM, Martin Sebor wrote:
While going through constexpr bugs looking for background
on one I'm currently working on I came across bug 65579 -
[C++11] gcc requires definition of a static constexpr member
even though it is not odr-used.
The bug points out that GCC (sometimes) emits references to
static constexpr data members of class templates even when
they aren't odr-used. (A more detailed analysis of why this
happens is in my comment #1 on the bug.)
The attached rather trivial patch seems to fix the problem
and (somewhat to my surprise) pass regression tests on x86_64.
Martin