re PR c++/85558 (ICE in make_rtl_for_nonlocal_decl when using static member of templa...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 13 Mar 2019 10:32:29 +0000 (10:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 13 Mar 2019 10:32:29 +0000 (10:32 +0000)
2019-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/85558
* g++.dg/other/friend16.C: New.
* g++.dg/other/friend17.C: Likewise.

From-SVN: r269644

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/friend16.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/friend17.C [new file with mode: 0644]

index 5ba400fa2b3e81c55171b92fb340e0454ac86d68..2439836d647417b6f74d25a1ed8cb4fa0d56af2f 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85558
+       * g++.dg/other/friend16.C: New.
+       * g++.dg/other/friend17.C: Likewise.
+
 2019-03-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/88588
diff --git a/gcc/testsuite/g++.dg/other/friend16.C b/gcc/testsuite/g++.dg/other/friend16.C
new file mode 100644 (file)
index 0000000..8c62ef6
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/85558
+
+template <typename T>
+struct triggerBug {
+  friend void doInitUser(bool = triggerBug::doInit);  // { dg-error "definition" }
+  static bool doInit;
+};
+
+template <class T>
+bool triggerBug<T>::doInit = true;
+
+triggerBug<int> bug;
diff --git a/gcc/testsuite/g++.dg/other/friend17.C b/gcc/testsuite/g++.dg/other/friend17.C
new file mode 100644 (file)
index 0000000..81269af
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/85558
+
+template <typename T>
+struct triggerBug {
+  friend void doInitUser(bool = triggerBug::doInit) {}
+  static bool doInit;
+};
+
+template <class T>
+bool triggerBug<T>::doInit = true;
+
+triggerBug<int> bug;