diff options
author | Anders Carlsson <andersca@mac.com> | 2009-07-11 00:55:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-07-11 00:55:33 +0000 |
commit | a0f71de52e827928eb9b84a40e9c8f69469a32ad (patch) | |
tree | ccf835884dfa34abc38f017994b8a66d98014c18 | |
parent | 6a75cd9c1d54625fca7b5477ab9545bcdbd85ea4 (diff) |
Add another test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75324 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp new file mode 100644 index 0000000000..6bdea20df6 --- /dev/null +++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp @@ -0,0 +1,10 @@ +// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +void f() { + auto a = a; // expected-error{{variable 'a' declared with 'auto' type cannot appear in its own initializer}} +} + +void g() { + auto a; // expected-error{{declaration of variable 'a' with type 'auto' requires an initializer}} + + auto *b; // expected-error{{declaration of variable 'b' with type 'auto *' requires an initializer}} +} |