Ignore:
Timestamp:
Aug 10, 2015, 4:46:08 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, string, with_gc
Children:
99f4165
Parents:
8c84ebd
Message:

Fix so void* does not have common type with function pointer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    r8c84ebd rdb4977a  
    138138        void CommonType::visit( PointerType *pointerType ) {
    139139                if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
    140                         if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {
     140                        if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) {
    141141                                result = otherPointer->clone();
    142142                                result->get_qualifiers() += pointerType->get_qualifiers();
    143                         } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {
     143                        } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) {
    144144                                result = pointerType->clone();
    145145                                result->get_qualifiers() += otherPointer->get_qualifiers();
Note: See TracChangeset for help on using the changeset viewer.