mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 00:45:28 +02:00
Correcting bit-masks when determining parameter offset for template parameters, related to 253080.
This commit is contained in:
parent
7b2a85caf7
commit
f6e95e2942
3 changed files with 7 additions and 7 deletions
|
@ -32,18 +32,18 @@ public interface ICPPTemplateParameter extends ICPPBinding {
|
|||
* Example:
|
||||
* <pre>
|
||||
* namespace ns {
|
||||
* template<typename T> class X { // parameter position: 0x0000
|
||||
* template<typename U> class Y1 { // parameter position: 0x0100
|
||||
* template<typename T> class X { // parameter position: 0x00000000
|
||||
* template<typename U> class Y1 { // parameter position: 0x00010000
|
||||
* };
|
||||
* class Y2 {
|
||||
* template typename<V> class Z { // parameter position: 0x0100
|
||||
* template typename<V> class Z { // parameter position: 0x00010000
|
||||
* void m();
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
* }
|
||||
* template<typename T> // parameter position 0x0000
|
||||
* template <typename V> // parameter position 0x0100
|
||||
* template<typename T> // parameter position 0x00000000
|
||||
* template <typename V> // parameter position 0x00010000
|
||||
* void ns::X<T>::Y2::Z<V>::m() {}
|
||||
* </pre>
|
||||
* @since 5.1
|
||||
|
|
|
@ -247,7 +247,7 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
|
|||
}
|
||||
|
||||
public IBinding resolveTemplateParameter(ICPPTemplateParameter templateParameter) {
|
||||
int pos= templateParameter.getParameterPosition() & 0xff;
|
||||
int pos= templateParameter.getParameterPosition() & 0xffff;
|
||||
|
||||
int tdeclLen= declarations == null ? 0 : declarations.length;
|
||||
for (int i= -1; i < tdeclLen; i++) {
|
||||
|
|
|
@ -239,7 +239,7 @@ public abstract class CPPTemplateParameter extends PlatformObject
|
|||
// use parameter from the index
|
||||
try {
|
||||
ICPPTemplateParameter[] params = template.getTemplateParameters();
|
||||
final int pos= position & 0xff;
|
||||
final int pos= position & 0xffff;
|
||||
if (pos < params.length)
|
||||
return params[pos];
|
||||
} catch (DOMException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue