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++/33176] strange diagnostic with "if (a) && b"



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


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