Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-985

[Linux/gcc] __is_base_of fails for private and protected inheritance

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: External
    • Labels:
      None
    • Environment:

      gcc-4.3

    • Severity:
      Incorrect Behavior

      Description

      The __is_base_of() helper provided with gcc-4.3 doesn't detect protected and private inheritance as required by the draft standard. It appears that the helper may be based on an older version of the standard and needs to be updated. Here is a note from the description of the is_base_of trait.

      [Note:Base classes that are private, protected, or ambigious are, nonetheless, base classes. —end note ]

      This is the gcc description of the helper that they provide..

      __is_base_of (base_type, derived_type)
      If base_type is a base class of derived_type ([class.derived]) then the trait is true, otherwise it is false. Top-level cv qualifications of base_type and derived_type are ignored. For the purposes of this trait, a class type is considered is own base. Requires: if __is_class (base_type) and __is_class (derived_type) are true and base_type and derived_type are not the same type (disregarding cv-qualifiers), derived_type shall be a complete type. Diagnostic is produced if this requirement is not met.

      Since there is no way to detect this from within the library, there isn't much we can do about fixing it.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vitek Travis Vitek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: