Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] RE: Question about transformation of template parameter

The identification of a template parameter shall not change during the process of specialization, so CPPMethodTemplateSpecialization  A<#10000> is correct. The java-doc of 'getParameterID()' should probably mention how it deals with explicit specializations.
 
I'll look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=271948 as soon as I find the time for it.
Markus.
 


From: sprigogin@xxxxxxxxxx [mailto:sprigogin@xxxxxxxxxx] On Behalf Of Sergey Prigogin
Sent: Wednesday, April 15, 2009 8:06 AM
To: Schorn, Markus
Cc: CDT General developers list.
Subject: Question about transformation of template parameter

Hi Markus,
Consider the following code:

template <typename T>
struct A {};

template <class U>
struct B {
  template <typename T>
  static A<T> f();
};

What should be the return type of B<int>::f ?

Existing code produces a CPPMethodTemplateSpecialization  A<#10000>, but shouldn't it be A<#0> instead since the type has been taken out of the enclosing template? Is there any function that would perform this kind of transformation?

This is related to my attempt to fix AST2TemplateTests.testTemplateConversionOperator_271948_2 in a clean way.

-sergey

Back to the top