[Bug c++/33176] strange diagnostic with "if (a) && b"

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 29 02:11:00 GMT 2007



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-08-29 02:10 -------
(In reply to comment #2)
> but it knows that "confirm" is a function template at this point, and can't be
> a future label. 

Yes it can.
Try:
template<typename T>
bool confirm(T t, int i) { return t == i; }
int main() {
    int i = 0, j = 1, k = 2;
    if (i == j)
      && confirm(j, k) )
    { i = 2; }
confirm:
    return 0;
    }

The point is that && is semi ambigous here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33176



More information about the Gcc-bugs mailing list