Title
Cv-qualified non-class rvalues
Status
nad
Section
7.2.1 [basic.lval]
Submitter
Jerry Coffin

Created on 2010-02-01.00:00:00 last changed 174 months ago

Messages

Date: 2010-08-15.00:00:00

Rationale (August, 2010):

The current specification is as intended.

Date: 2022-11-20.07:54:16

Historically, based on C's treatment, cv-qualification of non-class rvalues has been ignored in C++. With the advent of rvalue references, it's not quite as clear that this is desirable. For example, some implementations are reported to print const rvalue for the following program:

const int bar() {
   return 5;
}

void pass_int(int&& i) {
   printf("rvalue\n");
}

void pass_int(const int&& i) {
   printf("const rvalue\n");
}

int main() {
   pass_int(bar());
}

History
Date User Action Args
2010-08-23 00:00:00adminsetmessages: + msg2940
2010-08-23 00:00:00adminsetstatus: open -> nad
2010-02-01 00:00:00admincreate