mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 339475: Using explicit instance vs. partial specialization.
This commit is contained in:
parent
725a53f6da
commit
ccf2de4e53
2 changed files with 26 additions and 0 deletions
|
@ -5292,4 +5292,26 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testFunctionWithVoidParamInTypeDeduction() throws Exception {
|
public void testFunctionWithVoidParamInTypeDeduction() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template<typename T, unsigned length> struct Templ {
|
||||||
|
// Templ(){}
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// template<> struct Templ<int, 5> {
|
||||||
|
// Templ(){}
|
||||||
|
// int e;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// template<unsigned length> struct Templ<int, length> {
|
||||||
|
// Templ(){}
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// int main() {
|
||||||
|
// Templ<int, 5> iFive;
|
||||||
|
// iFive.e= 0;
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
public void testPartialSpecAfterExplicitInst_339475() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,10 @@ public class CPPTemplates {
|
||||||
map.put(param, pack);
|
map.put(param, pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ICPPTemplateInstance prim= getInstance(template, arguments, isDef);
|
||||||
|
if (prim != null && prim.isExplicitSpecialization())
|
||||||
|
return prim;
|
||||||
|
|
||||||
IBinding result= CPPTemplates.selectSpecialization(template, arguments, isDef);
|
IBinding result= CPPTemplates.selectSpecialization(template, arguments, isDef);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue