| 1663 | } |
| 1664 | |
| 1665 | bool TypeDecl::isSameType ( const TypeDecl & decl, |
| 1666 | RefMatters refMatters, |
| 1667 | ConstMatters constMatters, |
| 1668 | TemporaryMatters temporaryMatters, |
| 1669 | AllowSubstitute allowSubstitute, |
| 1670 | bool topLevel, |
| 1671 | bool isPassType ) const { |
| 1672 | if ( baseType!=decl.baseType ) { |
| 1673 | return false; |
| 1674 | } |
| 1675 | if ( topLevel && !isPointer() && !isRef() ) { |
| 1676 | constMatters = ConstMatters::no; |
| 1677 | } |
| 1678 | if ( topLevel && !isTempType() ) { |
| 1679 | temporaryMatters = TemporaryMatters::no; |
| 1680 | } |
| 1681 | if ( refMatters == RefMatters::yes ) { |
| 1682 | if ( ref!=decl.ref ) { |
| 1683 | return false; |
| 1684 | } |
| 1685 | } |
| 1686 | if ( constMatters == ConstMatters::yes ) { |
| 1687 | if ( constant!=decl.constant ) { |
| 1688 | return false; |
| 1689 | } |
| 1690 | } |
| 1691 | if ( temporaryMatters == TemporaryMatters::yes ) { |
| 1692 | if ( temporary != decl.temporary ) { |
| 1693 | return false; |
| 1694 | } |
| 1695 | } |
| 1696 | if ( dim!=decl.dim ) { |
| 1697 | return false; |
| 1698 | } |
| 1699 | switch ( baseType ) { |
| 1700 | case Type::tHandle: |
| 1701 | if ( annotation!=decl.annotation ) { |
| 1702 | if ( !isExplicit && (allowSubstitute == AllowSubstitute::yes) ) { |
| 1703 | if ( annotation->canSubstitute(decl.annotation) ) { |
| 1704 | return true; |
| 1705 | } else if ( decl.annotation->canBeSubstituted(annotation) ) { |
| 1706 | return true; |
| 1707 | } |
| 1708 | } |
| 1709 | return false; |
| 1710 | } |
| 1711 | break; |
| 1712 | case Type::tStructure: |
| 1713 | if (structType!=decl.structType ) { |
| 1714 | if ( !isExplicit && (allowSubstitute == AllowSubstitute::yes) ) { |
| 1715 | if ( structType && decl.structType && structType->isCompatibleCast(*(decl.structType)) ){ |
| 1716 | return true; |
| 1717 | } |
| 1718 | } |
| 1719 | return false; |
| 1720 | } |
| 1721 | break; |
| 1722 | case Type::tPointer: |
no test coverage detected