]> git.ipfire.org Git - people/ms/gcc.git/commit
c++: constexpr, inheritance, and local class [PR91933]
authorJason Merrill <jason@redhat.com>
Mon, 12 Apr 2021 21:43:51 +0000 (17:43 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 13 Apr 2021 12:25:16 +0000 (08:25 -0400)
commit0851ac6df0596df1e3b640e58094cf94ebb790b8
tree932fd95b824b4245356aeac1869e3ebef0335f1d
parent4acb3af3669db4ca79ffc97cd615fcea205bcccb
c++: constexpr, inheritance, and local class [PR91933]

Here we complained about referring to nm3 from the local class member
function because referring to the base class subobject involved taking the
variable's address.  Let's shortcut this case to avoid that.

gcc/cp/ChangeLog:

PR c++/91933
* class.c (build_base_path): Shortcut simple non-pointer case.

gcc/testsuite/ChangeLog:

PR c++/91933
* g++.dg/cpp0x/constexpr-base7.C: New test.
gcc/cp/class.c
gcc/testsuite/g++.dg/cpp0x/constexpr-base7.C [new file with mode: 0644]