typo-crash.cpp 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // FIXME: The diagnostics and recovery here are very, very poor.
  3. // PR10355
  4. template<typename T> void template_id1() { // expected-note {{'template_id1' declared here}} \
  5. // expected-note {{possible target for call}}
  6. template_id2<> t; // expected-error {{no template named 'template_id2'; did you mean 'template_id1'?}} \
  7. // expected-error {{expected ';' after expression}} \
  8. // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} \
  9. // expected-error {{use of undeclared identifier 't'}}
  10. }
  11. // FIXME: It would be nice if we could get this correction right.
  12. namespace PR12297 {
  13. namespace A {
  14. typedef short T;
  15. namespace B {
  16. typedef short T;
  17. T global(); // expected-note {{'::PR12297::global' declared here}}
  18. }
  19. }
  20. using namespace A::B;
  21. // FIXME: Adding '::PR12297::' is not needed as removing 'A::' is sufficient
  22. T A::global(); // expected-error {{out-of-line declaration of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean '::PR12297::global'?}}
  23. }