diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-11 22:38:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-11 22:38:07 +0000 |
commit | 2e12550e373fb90c6fca93d58e2c36114457019e (patch) | |
tree | 5c24f64e4b4ec5367b86ee5dbee205950d87c026 /clang | |
parent | 9a9ec73665dc71feb080581b70c62e7704f67f6c (diff) | |
download | bcm5719-llvm-2e12550e373fb90c6fca93d58e2c36114457019e.tar.gz bcm5719-llvm-2e12550e373fb90c6fca93d58e2c36114457019e.zip |
Allow us to compute linkage et al for instantiation-dependent types.
llvm-svn: 134932
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/AST/Type.cpp | 4 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index ca63ec87b11..20a0d595e41 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -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: diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index dd10ca4a211..8f1c682bb06 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -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))); +} |