p5.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
2968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldvoid f() {
3968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold  auto a = a; // expected-error{{variable 'a' declared with 'auto' type cannot appear in its own initializer}}
4968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold}
5968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold
6968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldstruct S { auto a; }; // expected-error{{'auto' not allowed in struct member}}
7968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold
8968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldvoid f(auto a) // expected-error{{'auto' not allowed in function prototype}}
9968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold{
10968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold  try { } catch (auto a) {  } // expected-error{{'auto' not allowed in exception declaration}}
11968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold}
12968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold
13968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldtemplate <auto a = 10> class C { }; // expected-error{{'auto' not allowed in template parameter}}
14968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold