xref: /llvm-project/clang/test/CXX/over/over.built/p15.cpp (revision d3dc7d077f1d9c9478813a34ed38abbcb4fc1ef5)
1 // RUN: %clang_cc1 -std=c++11 -verify %s -Wno-tautological-compare
2 
3 template <typename T, typename U>
f(int * pi,float * pf,T * pt,U * pu,T t)4 void f(int* pi, float* pf, T* pt, U* pu, T t) {
5   (void)(pi - pi);
6   (void)(pi - pf);  // expected-error {{not pointers to compatible types}}
7   (void)(pi - pt);
8   (void)(pu - pi);
9   (void)(pu - pt);
10   (void)(pu - t);
11   (void)(pi - t);
12 }
13