dependent-names-no-std.cpp 573 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. //
  3. // The whole point of this test is to verify certain diagnostics work in the
  4. // absence of namespace 'std'.
  5. namespace PR10053 {
  6. namespace ns {
  7. struct Data {};
  8. }
  9. template<typename T> struct A {
  10. T t;
  11. A() {
  12. f(t); // expected-error {{call to function 'f' that is neither visible in the template definition nor found by argument-dependent lookup}}
  13. }
  14. };
  15. void f(ns::Data); // expected-note {{in namespace 'PR10053::ns'}}
  16. A<ns::Data> a; // expected-note {{in instantiation of member function}}
  17. }