Commit a8138935 authored by Christian Kamm's avatar Christian Kamm Committed by hjk
Browse files

C++11: Fix and add test for simple decltype uses.



Change-Id: I7f843fa96e33671ecb135b9db6f68d9f2cbf2fac
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent c060d778
......@@ -3865,7 +3865,6 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierListAST *&node)
if (parseExpression(ast->expression))
match(T_RPAREN, &ast->rparen_token);
node = new (_pool) SpecifierListAST(ast);
skipUntilDeclaration();
return true;
} else if (lookAtBuiltinTypeSpecifier()) {
SimpleSpecifierAST *ast = new (_pool) SimpleSpecifierAST;
......
template <class T, class R>
auto foo(T t, R r) -> decltype(t + r)
{}
int x;
decltype(x) foo;
decltype(x) foo();
// this does not work yet, as decltype is only parsed as a simple-specifier
// and not also as a nested-name-specifier
//decltype(vec)::value_type a;
......@@ -147,6 +147,7 @@ void tst_cxx11::parse_data()
QTest::newRow("enums.1") << "enums.1.cpp" << "";
QTest::newRow("templateGreaterGreater.1") << "templateGreaterGreater.1.cpp" << "";
QTest::newRow("packExpansion.1") << "packExpansion.1.cpp" << "";
QTest::newRow("declType.1") << "declType.1.cpp" << "";
}
void tst_cxx11::parse()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment