mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 13:35:22 +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:
parent
037f64f533
commit
ebe2262314
2 changed files with 20 additions and 0 deletions
|
@ -2683,4 +2683,23 @@ public class IndexCPPTemplateResolutionTest extends IndexBindingResolutionTestBa
|
||||||
IVariable var2 = getBindingFromASTName("var2", 4);
|
IVariable var2 = getBindingFromASTName("var2", 4);
|
||||||
assertSameType(var1.getType(), var2.getType());
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2364,6 +2364,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
endOffset = calculateEndOffset(identifierName);
|
endOffset = calculateEndOffset(identifierName);
|
||||||
} else {
|
} else {
|
||||||
identifierName = nodeFactory.newName();
|
identifierName = nodeFactory.newName();
|
||||||
|
setRange(identifierName, endOffset, endOffset);
|
||||||
}
|
}
|
||||||
if (LT(1) == IToken.tASSIGN) { // optional = type-id
|
if (LT(1) == IToken.tASSIGN) { // optional = type-id
|
||||||
if (parameterPack)
|
if (parameterPack)
|
||||||
|
|
Loading…
Add table
Reference in a new issue