teak-llvm/clang/test/SemaTemplate/template-decl-fail.cpp
Douglas Gregor cbbf3e3b4a It's okay to reference an enum in a template definition, even though
it's ill-formed to form an enum template. Fixes <rdar://problem/7933063>.

llvm-svn: 102926
2010-05-03 17:48:54 +00:00

11 lines
364 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T> typedef T X; // expected-error{{typedef cannot be a template}}
template<typename T>
enum t0 { A = T::x }; // expected-error{{enumeration cannot be a template}} \
// expected-warning{{declaration does not declare anything}}
enum e0 {};
template<int x> enum e0 f0(int a=x) {}