]> granicus.if.org Git - clang/commitdiff
Add non-type template parameter test for disabled -Wtautological-compare
authorRichard Trieu <rtrieu@google.com>
Fri, 1 Nov 2013 22:12:15 +0000 (22:12 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 1 Nov 2013 22:12:15 +0000 (22:12 +0000)
warning in template specializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193890 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/compare.cpp

index 563a15251c301fe4dc6c94d3a76b7940bbafb991..02b029a7762fadf0e6360051872bd80dd33b8304 100644 (file)
@@ -399,4 +399,10 @@ namespace templates {
     less_than_zero<long>(num);
     less_than_zero<short>(num);
   }
+
+  template<unsigned n> bool compare(unsigned k) { return k >= n; }
+
+  void test12() {
+    compare<0>(42);
+  }
 }