[cfe-commits] r134932 - in /cfe/trunk: lib/AST/Type.cpp test/CodeGenCXX/mangle.cpp

Douglas Gregor dgregor at apple.com
Mon Jul 11 15:38:08 PDT 2011


Author: dgregor
Date: Mon Jul 11 17:38:07 2011
New Revision: 134932

URL: http://llvm.org/viewvc/llvm-project?rev=134932&view=rev
Log:
Allow us to compute linkage et al for instantiation-dependent types.

Modified:
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=134932&r1=134931&r2=134932&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Mon Jul 11 17:38:07 2011
@@ -1980,8 +1980,8 @@
 #define DEPENDENT_TYPE(Class,Base) case Type::Class:
 #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class,Base) case Type::Class:
 #include "clang/AST/TypeNodes.def"
-    // Treat dependent types as external.
-    assert(T->isDependentType());
+    // Treat instantiation-dependent types as external.
+    assert(T->isInstantiationDependentType());
     return CachedProperties(ExternalLinkage, DefaultVisibility, false);
 
   case Type::Builtin:

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=134932&r1=134931&r2=134932&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Mon Jul 11 17:38:07 2011
@@ -802,3 +802,11 @@
     // CHECK: call i32 @_ZN6test333fooINS_1BEEENS_1AIT_Xsr1XIS3_EE5valueEE4typeEv()
   }
 }
+
+namespace test34 {
+  template<typename T>
+  void f(decltype(sizeof(decltype(T() + T())))) {}
+
+  // CHECK: define weak_odr void @_ZN6test341fIiEEvDTstDTplcvT__EcvS1__EEE
+  template void f<int>(decltype(sizeof(1)));
+}





More information about the cfe-commits mailing list