]> granicus.if.org Git - clang/commitdiff
Allow us to compute linkage et al for instantiation-dependent types.
authorDouglas Gregor <dgregor@apple.com>
Mon, 11 Jul 2011 22:38:07 +0000 (22:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 11 Jul 2011 22:38:07 +0000 (22:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134932 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Type.cpp
test/CodeGenCXX/mangle.cpp

index ca63ec87b112ba7f45e827c43e9ef8cffa3cd9cf..20a0d595e41c4bb1755c9140d01d06b95368c377 100644 (file)
@@ -1980,8 +1980,8 @@ static CachedProperties computeCachedProperties(const Type *T) {
 #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:
index dd10ca4a211efcce34bf34dfd4bf1ac5e96d1c6d..8f1c682bb06b9d7088a082926493e9d24134b79d 100644 (file)
@@ -802,3 +802,11 @@ namespace test33 {
     // 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)));
+}