templateid.cpp 639 B

123456789101112131415161718
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // elaborated-type-specifier:
  3. // class-key '::'? nested-name-specifier? 'template'? simple-template-id
  4. // Tests that this form is accepted by the compiler but does not follow
  5. // the elaborated lookup rules of [basic.lookup.elab].
  6. template <typename> class Ident {}; // expected-note {{previous use is here}}
  7. namespace A {
  8. template <typename> void Ident();
  9. class Ident<int> AIdent; // expected-error {{refers to a function template}}
  10. class ::Ident<int> AnotherIdent;
  11. }
  12. class Ident<int> GlobalIdent;
  13. union Ident<int> GlobalIdent2; // expected-error {{ tag type that does not match }}