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;
+}


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to