[LLVMbugs] [Bug 14508] New: SubstTemplateTypeParmType::getReplacementType with typedefs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 4 10:07:31 PST 2012


             Bug #: 14508
           Summary: SubstTemplateTypeParmType::getReplacementType with
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: thomas at techsoft3d.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang::SubstTemplateTypeParmType::getReplacementType() will not return a
TypedefType if the replacement type was written in source code as a typedef
type. Instead, it will return the desugared typedef type.

This is problematic when trying to deal with typedefs such as size_t.

Test case:

#include <vector>

typedef std::vector<size_t> SizeTArray;

int main () {
    SizeTArray x;
        x.begin(), // incorrectly gets replacement type as BuiltinType
"unsigned int" instead of as TypedefType "size_t"
    return 0;

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list