From 06756ed901c35e2430f924eb6a3998d872eb1040 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 9 Apr 2018 17:16:05 -0400 Subject: [PATCH] PR c++/85279 - dump_expr doesn't understand decltype. * error.c (dump_expr): Handle DECLTYPE_TYPE. From-SVN: r259257 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/error.c | 1 + gcc/testsuite/g++.dg/cpp0x/decltype67.C | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype67.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 37f446feec0..c8eae2ef179 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-04-09 Jason Merrill + PR c++/85279 - dump_expr doesn't understand decltype. + * error.c (dump_expr): Handle DECLTYPE_TYPE. + PR c++/85262 - ICE with redundant qualification on constructor. * call.c (build_new_method_call_1): Move make_args_non_dependent after A::A() handling. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 75e853a1428..f27b700a434 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2714,6 +2714,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) case INTEGER_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: + case DECLTYPE_TYPE: pp_type_specifier_seq (pp, t); break; diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype67.C b/gcc/testsuite/g++.dg/cpp0x/decltype67.C new file mode 100644 index 00000000000..e8042ac59e7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype67.C @@ -0,0 +1,7 @@ +// PR c++/85279 +// { dg-do compile { target c++11 } } + +template struct A +{ + void foo(decltype(T())::Y); // { dg-error {decltype\(T\(\)\)::Y} } +}; -- 2.30.2