[cfe-commits] r75175 - in /cfe/trunk: lib/AST/Type.cpp test/SemaCXX/decltype-crash.cpp
Anders Carlsson
andersca at mac.com
Thu Jul 9 15:00:54 PDT 2009
Author: andersca
Date: Thu Jul 9 17:00:53 2009
New Revision: 75175
URL: http://llvm.org/viewvc/llvm-project?rev=75175&view=rev
Log:
Fix another decltype crash.
Added:
cfe/trunk/test/SemaCXX/decltype-crash.cpp
Modified:
cfe/trunk/lib/AST/Type.cpp
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=75175&r1=75174&r2=75175&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Thu Jul 9 17:00:53 2009
@@ -125,7 +125,7 @@
if (const TypeOfType *TOT = dyn_cast<TypeOfType>(this))
return TOT->getUnderlyingType().getDesugaredType();
if (const DecltypeType *DTT = dyn_cast<DecltypeType>(this))
- return DTT->getUnderlyingExpr()->getType().getDesugaredType();
+ return DTT->getCanonicalTypeInternal();
if (const TemplateSpecializationType *Spec
= dyn_cast<TemplateSpecializationType>(this)) {
if (ForDisplay)
Added: cfe/trunk/test/SemaCXX/decltype-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decltype-crash.cpp?rev=75175&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/decltype-crash.cpp (added)
+++ cfe/trunk/test/SemaCXX/decltype-crash.cpp Thu Jul 9 17:00:53 2009
@@ -0,0 +1,5 @@
+int& a();
+
+void f() {
+ decltype(a()) c;
+}
More information about the cfe-commits
mailing list