[LLVMbugs] [Bug 20215] New: Code-comment mismatch in AutoType::getDeducedType

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 5 10:51:16 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20215

            Bug ID: 20215
           Summary: Code-comment mismatch in AutoType::getDeducedType
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: yaron.keren at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140705/3dce2139/attachment.html>


More information about the llvm-bugs mailing list