diff options
author | Jason Merrill <jason@redhat.com> | 2020-02-03 11:11:55 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-02-03 17:50:36 -0500 |
commit | 8fda2c274ac66d60c1dfc1349e9efb4e8c2a3580 (patch) | |
tree | 9c5d0041838e29c8f570733b021348cd3effa683 /libgo | |
parent | 19e43cbce353b63a05c3b7c39d83a2e32c9f911f (diff) | |
download | gcc-8fda2c274ac66d60c1dfc1349e9efb4e8c2a3580.zip gcc-8fda2c274ac66d60c1dfc1349e9efb4e8c2a3580.tar.gz gcc-8fda2c274ac66d60c1dfc1349e9efb4e8c2a3580.tar.bz2 |
c++: Allow parm of empty class type in constexpr.
Since copying a class object is defined in terms of the copy constructor,
copying an empty class is OK even if it would otherwise not be usable in a
constant expression. Relatedly, using a parameter as an lvalue is no more
problematic than a local variable, and calling a member function uses the
object as an lvalue.
PR c++/91953
* constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
empty class type.
[COMPONENT_REF]: A member function reference doesn't use the object
as an rvalue.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions