summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-04-17 00:30:48 +0000
committerAdrian Prantl <aprantl@apple.com>2014-04-17 00:30:48 +0000
commit2c92e9cb53b8a0da29fe0392d6a1f324aae36116 (patch)
tree5c8630cc6a5d67387868adaffdcc455b35d5ec43 /clang/test/CodeGenCXX
parent5f6268a40ee3e17bbec910329f5b4e8eb940069f (diff)
downloadbcm5719-llvm-2c92e9cb53b8a0da29fe0392d6a1f324aae36116.tar.gz
bcm5719-llvm-2c92e9cb53b8a0da29fe0392d6a1f324aae36116.zip
Debug info: When collecting the parameters of C++ partial template
specializations collect all arguments and not just the ones from the class template partial specialization from which this class template specialization was instantiated. The debug info does not represent the partial specialization otherwise and so specialized parameters would go missing. rdar://problem/16636569. llvm-svn: 206430
Diffstat (limited to 'clang/test/CodeGenCXX')
-rw-r--r--clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp b/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
new file mode 100644
index 00000000000..cce84af4023
--- /dev/null
+++ b/clang/test/CodeGenCXX/debug-info-template-partial-specialization.cpp
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -g %s -o - -fstandalone-debug | FileCheck %s
+namespace __pointer_type_imp
+{
+ template <class _Tp, class _Dp, bool > struct __pointer_type1 {};
+
+ // CHECK: metadata ![[PARAMS:[0-9]+]], metadata !"_ZTSN18__pointer_type_imp15__pointer_type1I1C14default_deleteIS1_ELb0EEE"} ; [ DW_TAG_structure_type ] [__pointer_type1<C, default_delete<C>, false>] [line [[@LINE+1]], size 8, align 8, offset 0] [def] [from ]
+ template <class _Tp, class _Dp> struct __pointer_type1<_Tp, _Dp, false>
+ {
+ typedef _Tp* type;
+ };
+}
+template <class _Tp, class _Dp>
+struct __pointer_type2
+{
+ // Test that the bool template type parameter is emitted.
+ //
+ // CHECK: ![[PARAMS]] = metadata !{metadata !{{.*}}, metadata !{{.*}}, metadata ![[FALSE:[0-9]+]]}
+ // CHECK: ![[FALSE]] = {{.*}} i8 0, {{.*}}} ; [ DW_TAG_template_value_parameter ]
+ typedef typename __pointer_type_imp::__pointer_type1<_Tp, _Dp, false>::type type;
+};
+template <class _Tp> struct default_delete {};
+template <class _Tp, class _Dp = default_delete<_Tp> > class unique_ptr
+{
+ typedef typename __pointer_type2<_Tp, _Dp>::type pointer;
+ unique_ptr(pointer __p, _Dp __d) {}
+};
+class C {
+ unique_ptr<C> Ptr;
+};
+void foo(C &c) {
+}
OpenPOWER on IntegriCloud