Fixed AST for operator:: after template (#6195)

This commit is contained in:
PKEuS 2014-09-29 10:59:58 +02:00
parent 55b14853d0
commit 58fe668fc4
2 changed files with 4 additions and 1 deletions

View File

@ -557,7 +557,7 @@ static void compileScope(Token *&tok, AST_state& state)
if (tok)
compileTerm(tok, state);
if (binop->previous() && binop->previous()->isName())
if (binop->previous() && (binop->previous()->isName() || (binop->previous()->link() && binop->strAt(-1) == ">")))
compileBinOp(binop, state, nullptr);
else
compileUnaryOp(binop, state, nullptr);

View File

@ -8421,6 +8421,9 @@ private:
ASSERT_EQUALS("name_bytes[bits~unusedBits>>unusedBits<<{=", testAst("const uint8_t name_bytes[] = { (~bits >> unusedBits) << unusedBits };"));
ASSERT_EQUALS("abuf0{={=", testAst("a = { .buf = { 0 } };"));
ASSERT_EQUALS("tset{=", testAst("struct cgroup_taskset tset = {};"));
// template paratheses: <>
ASSERT_EQUALS("stdfabs::m_similarity(numeric_limitsepsilon::(<=return", testAst("return std::fabs(m_similarity) <= numeric_limits<double>::epsilon();")); // #6195
}
void astbrackets() const { // []