diff options
| author | Anders Carlsson <andersca@mac.com> | 2011-03-06 16:43:04 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2011-03-06 16:43:04 +0000 |
| commit | 829c4134b8657438964bf3a8257b7156cf93bc52 (patch) | |
| tree | 45853fcd71f87d6363bc455231d5f665e48853e6 /clang | |
| parent | 5022863fd8c4639b26882072f8f1401548da8721 (diff) | |
| download | bcm5719-llvm-829c4134b8657438964bf3a8257b7156cf93bc52.tar.gz bcm5719-llvm-829c4134b8657438964bf3a8257b7156cf93bc52.zip | |
Correctly unwrap 'auto' types. Fixes PR9414.
llvm-svn: 127121
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 3 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-cxx0x.cpp | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index bccf6e77cd9..b23b3922222 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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!"); diff --git a/clang/test/CodeGenCXX/debug-info-cxx0x.cpp b/clang/test/CodeGenCXX/debug-info-cxx0x.cpp new file mode 100644 index 00000000000..5753b05d728 --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-cxx0x.cpp @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-llvm-only -std=c++0x -g %s + +namespace PR9414 { + int f() { + auto x = 0; + return x; + } +} |

