diff mbox series

[committed] Add testcase for already fixed PR c++/84813

Message ID 20180312090941.GL8577@tucnak
State New
Headers show
Series [committed] Add testcase for already fixed PR c++/84813 | expand

Commit Message

Jakub Jelinek March 12, 2018, 9:09 a.m. UTC
Hi!

This PR got fixed in r251433 which I'm afraid is not backportable,
we were trying to register local specialization during dwarf2out_type_decl.

I've committed the testcase as obvious to trunk, so that we don't regress
on it again:

2018-03-12  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84813
	* g++.dg/debug/pr84813.C: New test.



	Jakub
diff mbox series

Patch

--- gcc/testsuite/g++.dg/debug/pr84813.C.jj	2018-03-12 09:57:50.197029595 +0100
+++ gcc/testsuite/g++.dg/debug/pr84813.C	2018-03-12 09:57:40.279028562 +0100
@@ -0,0 +1,33 @@ 
+// PR c++/84813
+// { dg-do compile }
+// { dg-options "-g -std=c++14" }
+
+template <typename>
+struct P {};
+
+template <int>
+struct F {
+  using type = int;
+};
+
+template <typename T>
+void
+apply ()
+{
+  constexpr int N = T::N;
+  [] (typename F<N>::type)
+  {
+    auto f = [] () {};
+    P<decltype (f)>{};
+  };
+}
+
+struct A {
+  static constexpr int N = 1;
+};
+
+void
+instantiate ()
+{
+  apply<A> ();
+}