[cfe-commits] r75324 - /cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp

Anders Carlsson andersca at mac.com
Fri Jul 10 17:55:53 PDT 2009


Author: andersca
Date: Fri Jul 10 19:55:33 2009
New Revision: 75324

URL: http://llvm.org/viewvc/llvm-project?rev=75324&view=rev
Log:
Add another test.

Added:
    cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp

Added: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp?rev=75324&view=auto

==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp (added)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp Fri Jul 10 19:55:33 2009
@@ -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}}
+}





More information about the cfe-commits mailing list