[Bug c++/15723] Over-eager warning not appropriate in templates

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Sun May 30 15:59:00 GMT 2004


------- Additional Comments From igodard at pacbell dot net  2004-05-29 12:18 -------
p.s. I tried without success to reproduce this warning in a simple template case e.g.:
#include    <iostream>
template<typename T>
void Foo(T t) { if (t < 0) std::cout << "foo" << std::endl; }
int main() {
    int i; unsigned int ui;
    Foo(i);
    Foo(ui);
    return 0;
    }


This suggests that the compiler already omits this warning for templates, and I have hit a bug (rather than a missing feature) in which it is still warning in the case I happened to hit.

Ivan

-- 


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



More information about the Gcc-bugs mailing list