Commit 3c635ef1 authored by Erik Verbruggen's avatar Erik Verbruggen

[C++] Correctly parse inline constructors for templates.

This failed for:
    template<class T> inline S<T>::S(nullptr_t):_p(0){}

Change-Id: Ibb48f403a66cb19567e65270aa166849ee81a162
Reviewed-by: default avatarRoberto Raggi <roberto.raggi@nokia.com>
parent 9bc042e0
......@@ -3727,7 +3727,8 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
if (LA() != T_SEMICOLON) {
const bool maybeCtor = (LA() == T_LPAREN && named_type_specifier);
if (! parseInitDeclarator(declarator, decl_specifier_seq, declaringClass) && maybeCtor) {
bool didParseInitDeclarator = parseInitDeclarator(declarator, decl_specifier_seq, declaringClass);
if ((! didParseInitDeclarator && maybeCtor) || (didParseInitDeclarator && maybeCtor && LA() == T_COLON)){
rewind(startOfNamedTypeSpecifier);
named_type_specifier = 0;
// pop the named type specifier from the decl-specifier-seq
......
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