summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-04 03:08:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-04 03:08:14 +0000
commitf7f21859750c062314ec58765f0d89ce8ce907a1 (patch)
tree4bba8e178f0c2fcf16525d603223d9ab13281795 /clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
parent7cab007902067c7588e1d736b1c1e216874b1fa7 (diff)
downloadbcm5719-llvm-f7f21859750c062314ec58765f0d89ce8ce907a1.tar.gz
bcm5719-llvm-f7f21859750c062314ec58765f0d89ce8ce907a1.zip
DebugInfo: Improvements/corrections to conservative emission of types in explicit template instantiation declarations
* detect out of line definitions correctly * detect member function explicit specializations correctly llvm-svn: 202779
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
index 6dfffb61144..86380392a20 100644
--- a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
+++ b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
@@ -38,7 +38,10 @@ void e<T>::f() {
}
extern template class e<int>;
e<int> ei;
-// CHECK: ; [ DW_TAG_structure_type ] [e<int>] {{.*}} [decl]
+// There's no guarantee that the out of line definition will appear before the
+// explicit template instantiation definition, so conservatively emit the type
+// definition here.
+// CHECK: ; [ DW_TAG_structure_type ] [e<int>] {{.*}} [def]
template <typename T>
struct f {
@@ -49,11 +52,7 @@ template <typename T>
void f<T>::g() {
}
f<int> fi;
-// Is this right? We don't seem to emit a def for 'f<int>::g' (even if it is
-// called in this translation unit) so I guess if we're relying on its
-// definition to be wherever the explicit instantiation definition is, we can do
-// the same for the debug info.
-// CHECK: ; [ DW_TAG_structure_type ] [f<int>] {{.*}} [decl]
+// CHECK: ; [ DW_TAG_structure_type ] [f<int>] {{.*}} [def]
template <typename T>
struct g {
@@ -70,3 +69,12 @@ struct h {
};
template class h<int>;
// CHECK: ; [ DW_TAG_structure_type ] [h<int>] {{.*}} [def]
+
+template <typename T>
+struct i {
+ void f() {}
+};
+template<> void i<int>::f();
+extern template class i<int>;
+i<int> ii;
+// CHECK: ; [ DW_TAG_structure_type ] [i<int>] {{.*}} [def]
OpenPOWER on IntegriCloud