mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +02:00
Bug 513430 - sizeof() with dependent type in default template argument
Change-Id: I01b21afb076b29e418a4d9eece2ac8eff3dafbb6
This commit is contained in:
parent
57332b1d1d
commit
1dcc3613f7
3 changed files with 16 additions and 3 deletions
|
@ -10160,7 +10160,6 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
public void testNoexceptSpecifierInTypeTemplateArgument_511186() throws Exception {
|
public void testNoexceptSpecifierInTypeTemplateArgument_511186() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace ns {
|
// namespace ns {
|
||||||
//
|
//
|
||||||
// template <typename T>
|
// template <typename T>
|
||||||
|
@ -10180,4 +10179,18 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
public void testFriendFunctionDeclarationInNamespace_513681() throws Exception {
|
public void testFriendFunctionDeclarationInNamespace_513681() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template<class T, unsigned long Size = sizeof(T)>
|
||||||
|
// class foobar {};
|
||||||
|
//
|
||||||
|
// template<class T>
|
||||||
|
// void waldo(foobar<T>) {}
|
||||||
|
//
|
||||||
|
// void bar() {
|
||||||
|
// foobar<int> obj;
|
||||||
|
// waldo(obj); // Error: Invalid arguments
|
||||||
|
// }
|
||||||
|
public void testDependentSizeofInDefaultArgument_513430() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,6 @@ public class EvalBinaryTypeId extends CPPDependentEvaluation {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean referencesTemplateParameter() {
|
public boolean referencesTemplateParameter() {
|
||||||
return false;
|
return CPPTemplates.isDependentType(fType1) || CPPTemplates.isDependentType(fType2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,6 +234,6 @@ public class EvalUnaryTypeID extends CPPDependentEvaluation {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean referencesTemplateParameter() {
|
public boolean referencesTemplateParameter() {
|
||||||
return false;
|
return CPPTemplates.isDependentType(fOrigType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue