mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 481078 - Unwrap typedefs when checking for composite pointer
conversion Change-Id: I70d99f16c32fd2c00971fd20114c45cae3b08785 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
728a032bde
commit
e5d0038f49
2 changed files with 13 additions and 0 deletions
|
@ -10748,6 +10748,17 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// struct S {};
|
||||
// typedef S* S_ptr;
|
||||
// void waldo(S*);
|
||||
// S_ptr s;
|
||||
// int main() {
|
||||
// waldo(false ? s : 0);
|
||||
// }
|
||||
public void testTypedefOfPointerInConditional_481078() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <bool>
|
||||
// struct enable_if {
|
||||
// };
|
||||
|
|
|
@ -1170,6 +1170,8 @@ public class Conversions {
|
|||
* the pointer is not possible, the method returns {@code null}.
|
||||
*/
|
||||
public static IType compositePointerType(IType t1, IType t2, IASTNode point) {
|
||||
t1 = SemanticUtil.getNestedType(t1, TDEF);
|
||||
t2 = SemanticUtil.getNestedType(t2, TDEF);
|
||||
final boolean isPtr1 = t1 instanceof IPointerType;
|
||||
if (isPtr1 || isNullPtr(t1)) {
|
||||
if (isNullPointerConstant(t2)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue