This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33176] strange diagnostic with "if (a) && b"
- 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: 29 Aug 2007 02:10:46 -0000
- Subject: [Bug c++/33176] strange diagnostic with "if (a) && b"
- References: <bug-33176-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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