aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2019-06-13 01:31:03 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2019-06-13 01:31:03 +0000
commitedde16fc017f0b070f82c309d78a3ef5377d83bd (patch)
treefb479c35507a48837a54dec1fcd4f6cb12fff08e /gcc
parent12e0d27abb0f74ea4d8262cd6809c0fe779e6875 (diff)
downloadgcc-edde16fc017f0b070f82c309d78a3ef5377d83bd.zip
gcc-edde16fc017f0b070f82c309d78a3ef5377d83bd.tar.gz
gcc-edde16fc017f0b070f82c309d78a3ef5377d83bd.tar.bz2
re PR c++/87410 (internal compiler error: in fold_convert_loc, at fold-const.c:2530)
PR c++/87410 * g++.dg/cpp1y/pr87410.C: New test. From-SVN: r272230
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr87410.C19
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1c49ab9..591d1f4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2019-06-12 Marek Polacek <polacek@redhat.com>
+ PR c++/87410
+ * g++.dg/cpp1y/pr87410.C: New test.
+
+2019-06-12 Marek Polacek <polacek@redhat.com>
+
PR c++/66999 - 'this' captured by reference.
* g++.dg/cpp0x/lambda/lambda-this21.C: New test.
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr87410.C b/gcc/testsuite/g++.dg/cpp1y/pr87410.C
new file mode 100644
index 0000000..5a691e4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/pr87410.C
@@ -0,0 +1,19 @@
+// PR c++/87410
+// { dg-do compile { target c++14 } }
+
+template <long a> using b = const char[a];
+template <typename, int c, int e, typename f>
+constexpr auto g(b<c> &, b<e> &, f) {}
+template <typename d, int a> auto h(b<a> &) {
+ auto i = j(static_cast<d **>(nullptr));
+ return **i;
+}
+class k {
+ using l = k;
+ const int &m() const;
+ friend constexpr auto j(l **n) -> decltype(n) {
+ g<int>("", "", static_cast<const int &(k::*)() const>(&k::m));
+ return n;
+ }
+};
+k o = h<k, 1>("");