Skip to content

Commit 5c5ef43

Browse files
author
kroening
committed
parse C++11 auto declarations
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@4142 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 718cbaf commit 5c5ef43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cpp/parse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ bool Parser::rDeclaration(cpp_declarationt &declaration)
10361036
std::cout << "Parser::rDeclaration 6 " << t << "\n";
10371037
#endif
10381038

1039-
if(cv_q.is_not_nil() &&
1039+
if((cv_q.is_not_nil() || storage_spec.is_auto()) &&
10401040
((t==TOK_IDENTIFIER && lex.LookAhead(1)=='=') || t=='*'))
10411041
return rConstDeclaration(declaration, storage_spec, member_spec, cv_q);
10421042
else
@@ -6610,7 +6610,7 @@ bool Parser::rDeclarationStatement(codet &statement)
66106610
std::cout << "Parser::rDeclarationStatement 3 " << t << "\n";
66116611
#endif
66126612

6613-
if(cv_q.is_not_nil() &&
6613+
if((cv_q.is_not_nil() || storage_spec.is_auto()) &&
66146614
((t==TOK_IDENTIFIER && lex.LookAhead(1)=='=') || t=='*'))
66156615
{
66166616
#ifdef DEBUG

0 commit comments

Comments
 (0)