Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 class X {
      3 public:
      4   virtual int f();
      5 };
      6 
      7 void g(int); // expected-note{{candidate function}}
      8 
      9 template<typename T>
     10 T f(T x) {
     11   (void)(x + 0);
     12   (void)T(0);
     13   (void)(x += 0);
     14   (void)(x? x : x);
     15   (void)static_cast<int>(x);
     16   (void)reinterpret_cast<int>(x);
     17   (void)dynamic_cast<X*>(&x);
     18   (void)const_cast<int>(x);
     19   return g(x);
     20   h(x); // h is a dependent name
     21   g(1, 1); // expected-error{{no matching function for call}}
     22   h(1); // expected-error{{use of undeclared identifier 'h'}}
     23   return 0;
     24 }
     25 
     26 // This one entered into an infinite loop.
     27 template <unsigned long N>
     28 void rdar8520617() {
     29   if (N > 1) { }
     30 }
     31 
     32 int f2() {
     33   rdar8520617<0>();
     34 }
     35 
     36