Changeset 4559b34 for src/ResolvExpr
- Timestamp:
- Apr 3, 2022, 8:49:42 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 92538ab
- Parents:
- 3eb1653
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ResolvExpr/Resolver.cc ¶
r3eb1653 r4559b34 1470 1470 // enumerator initializers should not use the enum type to initialize, since the 1471 1471 // enum type is still incomplete at this point. Use `int` instead. 1472 objectDecl = fixObjectType(objectDecl, symtab); 1473 currentObject = ast::CurrentObject{ 1474 objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } }; 1472 1473 if (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base) { // const ast::PointerType & 1474 const ast::Type * enumBase = (dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() )->base->base.get()); 1475 const ast::PointerType * enumBaseAsPtr = dynamic_cast<const ast::PointerType *>(enumBase); 1476 1477 if ( enumBaseAsPtr ) { 1478 const ast::Type * pointerBase = enumBaseAsPtr->base.get(); 1479 if ( dynamic_cast<const ast::BasicType *>(pointerBase) ) { 1480 objectDecl = fixObjectType(objectDecl, symtab); 1481 if (dynamic_cast<const ast::BasicType *>(pointerBase)->kind == ast::BasicType::Char) 1482 currentObject = ast::CurrentObject{ 1483 objectDecl->location, new ast::PointerType{ 1484 new ast::BasicType{ ast::BasicType::Char } 1485 } }; 1486 } else { 1487 objectDecl = fixObjectType(objectDecl, symtab); 1488 currentObject = ast::CurrentObject{objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } }; 1489 } 1490 } 1491 } else { 1492 objectDecl = fixObjectType(objectDecl, symtab); 1493 currentObject = ast::CurrentObject{ 1494 objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } }; 1495 } 1496 1475 1497 } 1476 1498 else {
Note: See TracChangeset
for help on using the changeset viewer.