mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 395019 - Error when using __is_base_of
Change-Id: Ife9a63658555b7a94246b0d938dd139bb8d0ab08 Reviewed-on: https://git.eclipse.org/r/9060 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
a9cbaf44fc
commit
66bb47cde0
2 changed files with 17 additions and 3 deletions
|
@ -9953,8 +9953,8 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
// template<int I> struct CT {};
|
// template<int I> struct CT {};
|
||||||
// typedef int TD;
|
// typedef int TD;
|
||||||
// bool operator==(S1 a, int r );
|
// bool operator==(S1 a, int r );
|
||||||
// static const int x = sizeof(CT<i>((TD * (CT<sizeof(s1 == 1)>::*)) 0 ));
|
// static const int x = sizeof(CT<i>((TD * (CT<sizeof(s1 == 1)>::*)) 0));
|
||||||
// template<int I> bool operator==(S1 a, const CT<I>& r );
|
// template<int I> bool operator==(S1 a, const CT<I>& r);
|
||||||
public void testOrderInAmbiguityResolution_390759() throws Exception {
|
public void testOrderInAmbiguityResolution_390759() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
@ -9973,4 +9973,16 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
public void testADLForFunctionObject_388287() throws Exception {
|
public void testADLForFunctionObject_388287() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <bool> struct A {};
|
||||||
|
// template <>
|
||||||
|
// struct A<false> {
|
||||||
|
// typedef int type;
|
||||||
|
// };
|
||||||
|
// struct S {};
|
||||||
|
// const bool b = __is_base_of(S, int);
|
||||||
|
// typedef A<b>::type T;
|
||||||
|
public void testIsBaseOf_395019() throws Exception {
|
||||||
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,8 +334,10 @@ public class Value implements IValue {
|
||||||
IType type1, IType type2, IASTNode point) {
|
IType type1, IType type2, IASTNode point) {
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case __is_base_of:
|
case __is_base_of:
|
||||||
if (type1 instanceof ICPPClassType && type1 instanceof ICPPClassType) {
|
if (type1 instanceof ICPPClassType && type2 instanceof ICPPClassType) {
|
||||||
return ClassTypeHelper.isSubclass((ICPPClassType) type2, (ICPPClassType) type1) ? 1 : 0;
|
return ClassTypeHelper.isSubclass((ICPPClassType) type2, (ICPPClassType) type1) ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return VALUE_CANNOT_BE_DETERMINED;
|
return VALUE_CANNOT_BE_DETERMINED;
|
||||||
|
|
Loading…
Add table
Reference in a new issue