This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/42655] ! causes the qualified types for rvalue



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]