aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2017-08-03 09:26:17 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2017-08-03 09:26:17 +0000
commite5e691a53fe4d2fd6e437d754fae75c4804c0256 (patch)
tree6f795c4db3c36f8b4c5eda23929eb85082064554 /gcc
parent0a734553cc49e4767dfefa1328d1fb5cf464650b (diff)
downloadgcc-e5e691a53fe4d2fd6e437d754fae75c4804c0256.zip
gcc-e5e691a53fe4d2fd6e437d754fae75c4804c0256.tar.gz
gcc-e5e691a53fe4d2fd6e437d754fae75c4804c0256.tar.bz2
re PR c++/71440 (ICE on invalid C++ code in instantiate_type, at cp/class.c:8247)
/cp 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71440 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor / destructor as expressions. /testsuite 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71440 * g++.dg/template/crash127.C: New. From-SVN: r250848
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/crash127.C22
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8be4294..041c6c4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71440
+ * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
+ destructor as expressions.
+
2017-08-02 Jakub Jelinek <jakub@redhat.com>
PR c++/81640
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 3dc6404..a58de1d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5487,9 +5487,9 @@ build_x_unary_op (location_t loc, enum tree_code code, cp_expr xarg,
{
if (complain & tf_error)
error (DECL_CONSTRUCTOR_P (fn)
- ? G_("taking address of constructor %qE")
- : G_("taking address of destructor %qE"),
- xarg.get_value ());
+ ? G_("taking address of constructor %qD")
+ : G_("taking address of destructor %qD"),
+ fn);
return error_mark_node;
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a8077a5..58e1b87 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71440
+ * g++.dg/template/crash127.C: New.
+
2017-08-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/81052
diff --git a/gcc/testsuite/g++.dg/template/crash127.C b/gcc/testsuite/g++.dg/template/crash127.C
new file mode 100644
index 0000000..b7c0325
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash127.C
@@ -0,0 +1,22 @@
+// PR c++/71440
+
+struct A
+{
+ void f () {}
+};
+
+typedef void (A::*Ptr) ();
+
+template < Ptr > struct B {};
+
+template < class T >
+struct C : public A
+{
+ void bar ()
+ {
+ B < &A::A > b; // { dg-error "taking address of constructor 'A::A" "" { target c++98_only } }
+ // { dg-error "taking address of constructor 'constexpr A::A" "" { target c++11 } .-1 }
+ }
+};
+
+template class C < int >;