This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42655] New: Don't qualify rvalues of non-class types
- From: "schaub-johannes at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jan 2010 03:17:42 -0000
- Subject: [Bug c++/42655] New: Don't qualify rvalues of non-class types
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC applies cv-qualifiers to rvalues of non-class types. The following code is
all right, but GCC doesn't like it:
template<typename T>
void unused(T const &) { }
int main() {
volatile bool x = false;
unused(!x); // type of "!x" is bool
}
--
Summary: Don't qualify rvalues of non-class types
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schaub-johannes at web dot de
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42655