Skip to content

Code-comment mismatch in AutoType::getDeducedType #20589

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 20215
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

The code in clang\AST\Type.h:3678 for AutoType reads:

  /// \brief Get the type deduced for this auto type, or null if it's either
  /// not been deduced or was deduced to a dependent type.
  QualType getDeducedType() const {
    return !isCanonicalUnqualified() ? getCanonicalTypeInternal() : QualType();
  }
  bool isDeduced() const {
    return !isCanonicalUnqualified() || isDependentType();
  }

the comment does not seem to match the logic of getDeducedType.

Either the code needs to be

  QualType getDeducedType() const {
    return isDeduced() ? getCanonicalTypeInternal() : QualType();
  }

or the comment changed, I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions