Changeset 4559b34 for src/SymTab
- Timestamp:
 - Apr 3, 2022, 8:49:42 PM (4 years ago)
 - Branches:
 - ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
 - Children:
 - 92538ab
 - Parents:
 - 3eb1653
 - File:
 - 
      
- 1 edited
 
- 
          
  src/SymTab/Validate.cc (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
src/SymTab/Validate.cc
r3eb1653 r4559b34 939 939 // need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information. 940 940 SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init ); 941 ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer ); 941 if ( !enumDecl->base || dynamic_cast<BasicType *>(enumDecl->base)) 942 ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer ); 943 else { 944 if (dynamic_cast<PointerType *>(enumDecl->base)) { 945 auto typePtr = dynamic_cast<PointerType *>(enumDecl->base); 946 ResolvExpr::findSingleExpression( init->value, 947 new PointerType( Type::Qualifiers(), typePtr->base ), indexer ); 948 } else { 949 ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer ); 950 } 951 } 952 942 953 } 943 954 } 955 944 956 } // if 945 957 }  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.