diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-05-10 22:53:25 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-05-10 22:53:25 +0000 |
commit | 776a36453a48f3d1f305b83fbdf1632dde808ab5 (patch) | |
tree | 6480813692ed4b85a094795972abb899e2e2c57d | |
parent | 30a16f1383b56cb71be251999a577b2e37db2ce0 (diff) | |
download | clang-776a36453a48f3d1f305b83fbdf1632dde808ab5.tar.gz clang-776a36453a48f3d1f305b83fbdf1632dde808ab5.tar.bz2 clang-776a36453a48f3d1f305b83fbdf1632dde808ab5.tar.xz |
Debug Info: Silently accept template argument packs
We could support the GCC extension DW_TAG_GNU_template_parameter_pack if
we're feeling adventurous, at some point - but I don't think GDB's doing
anything useful with it yet anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181644 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCXX/debug-info-template.cpp | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index f236d169bf..dbae6e9699 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1264,10 +1264,12 @@ CollectTemplateParams(const TemplateParameterList *TPList, // We could support this with the GCC extension // DW_TAG_GNU_template_template_param break; + case TemplateArgument::Pack: + // And this with DW_TAG_GNU_template_parameter_pack + break; // these next 4 should never occur case TemplateArgument::Expression: case TemplateArgument::TemplateExpansion: - case TemplateArgument::Pack: case TemplateArgument::Null: llvm_unreachable( "These argument types shouldn't exist in concrete types"); diff --git a/test/CodeGenCXX/debug-info-template.cpp b/test/CodeGenCXX/debug-info-template.cpp index 7b987ef97c..1d2dc10cf2 100644 --- a/test/CodeGenCXX/debug-info-template.cpp +++ b/test/CodeGenCXX/debug-info-template.cpp @@ -1,5 +1,12 @@ // RUN: %clang -S -emit-llvm -target x86_64-unknown_unknown -g %s -o - -std=c++11 | FileCheck %s +// CHECK: [[EMPTY:![0-9]*]] = metadata !{i32 0} + +// func<...> doesn't have any template arguments listed since we don't support +// packs yet. This could be encoded with GNU's +// DW_TAG_GNU_template_parameter_pack extension. +// CHECK: {{.*}}, metadata [[EMPTY]], i32 {{[0-9]*}}} ; [ DW_TAG_subprogram ] {{.*}} [func<int>] + // CHECK: [[INT:![0-9]*]] = {{.*}} ; [ DW_TAG_base_type ] [int] // CHECK: metadata [[TCI:![0-9]*]], i32 0, i32 1, %class.TC* @tci, null} ; [ DW_TAG_variable ] [tci] // CHECK: [[TC:![0-9]*]] = {{.*}}, metadata [[TCARGS:![0-9]*]]} ; [ DW_TAG_class_type ] [TC<unsigned int, 2, &glb, &foo::e, &foo::f>] @@ -67,3 +74,6 @@ int glb; TC<unsigned, 2, &glb, &foo::e, &foo::f> tci; TC<int, -3, nullptr, nullptr, nullptr> tcn; + +template<typename ...Ts> int func() { return 0; } +int anchor = func<int>(); |