This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42655] ! causes the qualified types for rvalue
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jan 2010 03:22:49 -0000
- Subject: [Bug c++/42655] ! causes the qualified types for rvalue
- References: <bug-42655-16474@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2010-01-08 03:22 -------
Looks like it is only an issue with ! (and bool) and not with any other
expression really.
template<typename T>
void unused(T const &) { }
int main() {
volatile int x = false;
unused(x-0);
}
Causes unused<int>() to be called.
Also note !!x uses volatile bool which is also wrong.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid, wrong-code
Summary|Don't qualify rvalues of |! causes the qualified types
|non-class types |for rvalue
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42655