1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 472199 - Give correct offset to name of unnamed template parameter

Change-Id: Ie668dd02827b9e9a9c5e02700937a48471facfe1
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
Nathan Ridge 2015-07-09 20:08:41 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent 037f64f533
commit ebe2262314
2 changed files with 20 additions and 0 deletions

View file

@ -2683,4 +2683,23 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
IVariable var2 = getBindingFromASTName("var2", 4);
assertSameType(var1.getType(), var2.getType());
}
// template <typename T>
// struct allocator {
// typedef T value_type;
// };
// template <typename> struct allocator;
//
// struct Item {
// int waldo;
// };
//
// int main() {
// allocator<Item>::value_type item;
// item.waldo = 5;
// }
public void testRedeclarationWithUnnamedTemplateParameter_472199() throws Exception {
checkBindings();
}
}

View file

@ -2364,6 +2364,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
endOffset = calculateEndOffset(identifierName);
} else {
identifierName = nodeFactory.newName();
setRange(identifierName, endOffset, endOffset);
}
if (LT(1) == IToken.tASSIGN) { // optional = type-id
if (parameterPack)