From ae01993a12d609702087b8bcc7e0a3a853851127 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 11 Jul 2009 00:34:39 +0000 Subject: Implement more of C++0x 'auto'. A variable with an auto type specifier must have an initializer. Also, move some tests around to match the C++0x draft better. llvm-svn: 75322 --- clang/lib/Parse/ParseDecl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5566751fb99..1ddd20a9ecb 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -465,7 +465,9 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D, CommaLocs.data(), RParenLoc); } } else { - Actions.ActOnUninitializedDecl(ThisDecl); + bool TypeContainsUndeducedAuto = + D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto; + Actions.ActOnUninitializedDecl(ThisDecl, TypeContainsUndeducedAuto); } return ThisDecl; -- cgit v1.2.3