summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C')
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
new file mode 100644
index 00000000000..c5520fa72b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-4" } */
+
+/* Regression test for an ICE in output_die when using -gdwarf-4. */
+
+namespace {
+
+struct A {
+ virtual ~A();
+};
+
+struct B : public A {
+ template <typename A>
+ bool foo(A x[2]) { }
+};
+
+template <typename T>
+struct C {
+ T v[2];
+};
+
+template <typename T>
+bool X(T &b) {
+ typedef C<int> D;
+ D x[2];
+ return b.foo(x);
+}
+
+void f() {
+ B b;
+ X<B>(b);
+}
+
+}