mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 460080 - Template id inside special cast expression forming '>>'
Change-Id: I949cef0c6774c4c90edce921c2cc99f514ffea87 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
8607866e33
commit
ce34d2d48e
2 changed files with 12 additions and 1 deletions
|
@ -11076,4 +11076,10 @@ public class AST2CPPTests extends AST2TestBase {
|
||||||
public void testASTCopyForNoexceptDefault_bug456207() throws Exception {
|
public void testASTCopyForNoexceptDefault_bug456207() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename> struct waldo { waldo(int); };
|
||||||
|
// auto x = static_cast<waldo<int>>(0);
|
||||||
|
public void testTemplateIdInsideCastOperator_460080() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1957,7 +1957,12 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
final int optype= consume().getType();
|
final int optype= consume().getType();
|
||||||
consume(IToken.tLT);
|
consume(IToken.tLT);
|
||||||
final IASTTypeId typeID = typeId(DeclarationOptions.TYPEID);
|
final IASTTypeId typeID = typeId(DeclarationOptions.TYPEID);
|
||||||
consumeOrEOC(IToken.tGT);
|
final IToken gt = LA(1);
|
||||||
|
if (gt.getType() == IToken.tGT || gt.getType() == IToken.tGT_in_SHIFTR) {
|
||||||
|
consume();
|
||||||
|
} else if (gt.getType() != IToken.tEOC) {
|
||||||
|
throwBacktrack(gt);
|
||||||
|
}
|
||||||
consumeOrEOC(IToken.tLPAREN);
|
consumeOrEOC(IToken.tLPAREN);
|
||||||
IASTExpression operand= null;
|
IASTExpression operand= null;
|
||||||
if (LT(1) != IToken.tEOC) {
|
if (LT(1) != IToken.tEOC) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue