Correctly unwrap 'auto' types. Fixes PR9414.

llvm-svn: 127121
This commit is contained in:
Anders Carlsson 2011-03-06 16:43:04 +00:00
parent 5022863fd8
commit 829c4134b8
2 changed files with 11 additions and 0 deletions

View File

@ -1374,6 +1374,9 @@ static QualType UnwrapTypeForDebugInfo(QualType T) {
case Type::SubstTemplateTypeParm:
T = cast<SubstTemplateTypeParmType>(T)->getReplacementType();
break;
case Type::Auto:
T = cast<AutoType>(T)->getDeducedType();
break;
}
assert(T != LastT && "Type unwrapping failed to unwrap!");

View File

@ -0,0 +1,8 @@
// RUN: %clang_cc1 -emit-llvm-only -std=c++0x -g %s
namespace PR9414 {
int f() {
auto x = 0;
return x;
}
}