* typeck.c (build_binary_op): Do not warn about signed
vs. unsigned comparisons in the bodies of templates.
* g++.dg/warn/Wsign-compare-1.C: New test.
From-SVN: r69222
2003-07-10 Mark Mitchell <mark@codesourcery.com>
+ * typeck.c (build_binary_op): Do not warn about signed
+ vs. unsigned comparisons in the bodies of templates.
+
PR c++/9411
* parser.c (cp_parser_postfix_expression): Check dependency of
functions.
}
if ((short_compare || code == MIN_EXPR || code == MAX_EXPR)
- && warn_sign_compare)
+ && warn_sign_compare
+ /* Do not warn until the template is instantiated; we cannot
+ bound the ranges of the arguments until that point. */
+ && !processing_template_decl)
{
int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
+2003-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/warn/Wsign-compare-1.C: New test.
+
2003-07-10 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/20021018-1.c: Disable if the sizeof (int) < 4.
--- /dev/null
+// { dg-options "-Wsign-compare" }
+
+extern unsigned u;
+
+template<class F>
+int f() { return u > 1; }