mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +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:
|
* Example:
|
||||||
* <pre>
|
* <pre>
|
||||||
* namespace ns {
|
* namespace ns {
|
||||||
* template<typename T> class X { // parameter position: 0x0000
|
* template<typename T> class X { // parameter position: 0x00000000
|
||||||
* template<typename U> class Y1 { // parameter position: 0x0100
|
* template<typename U> class Y1 { // parameter position: 0x00010000
|
||||||
* };
|
* };
|
||||||
* class Y2 {
|
* class Y2 {
|
||||||
* template typename<V> class Z { // parameter position: 0x0100
|
* template typename<V> class Z { // parameter position: 0x00010000
|
||||||
* void m();
|
* void m();
|
||||||
* };
|
* };
|
||||||
* };
|
* };
|
||||||
* };
|
* };
|
||||||
* }
|
* }
|
||||||
* template<typename T> // parameter position 0x0000
|
* template<typename T> // parameter position 0x00000000
|
||||||
* template <typename V> // parameter position 0x0100
|
* template <typename V> // parameter position 0x00010000
|
||||||
* void ns::X<T>::Y2::Z<V>::m() {}
|
* void ns::X<T>::Y2::Z<V>::m() {}
|
||||||
* </pre>
|
* </pre>
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
|
|
|
@ -247,7 +247,7 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBinding resolveTemplateParameter(ICPPTemplateParameter templateParameter) {
|
public IBinding resolveTemplateParameter(ICPPTemplateParameter templateParameter) {
|
||||||
int pos= templateParameter.getParameterPosition() & 0xff;
|
int pos= templateParameter.getParameterPosition() & 0xffff;
|
||||||
|
|
||||||
int tdeclLen= declarations == null ? 0 : declarations.length;
|
int tdeclLen= declarations == null ? 0 : declarations.length;
|
||||||
for (int i= -1; i < tdeclLen; i++) {
|
for (int i= -1; i < tdeclLen; i++) {
|
||||||
|
|
|
@ -239,7 +239,7 @@ public abstract class CPPTemplateParameter extends PlatformObject
|
||||||
// use parameter from the index
|
// use parameter from the index
|
||||||
try {
|
try {
|
||||||
ICPPTemplateParameter[] params = template.getTemplateParameters();
|
ICPPTemplateParameter[] params = template.getTemplateParameters();
|
||||||
final int pos= position & 0xff;
|
final int pos= position & 0xffff;
|
||||||
if (pos < params.length)
|
if (pos < params.length)
|
||||||
return params[pos];
|
return params[pos];
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue