PR c++/85279 - dump_expr doesn't understand decltype.
authorJason Merrill <jason@redhat.com>
Mon, 9 Apr 2018 21:16:05 +0000 (17:16 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 9 Apr 2018 21:16:05 +0000 (17:16 -0400)
* error.c (dump_expr): Handle DECLTYPE_TYPE.

From-SVN: r259257

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/g++.dg/cpp0x/decltype67.C [new file with mode: 0644]

index 37f446feec0894434613b431b3746bf2c4400ab1..c8eae2ef179bc46f6842c17489a83b5e7ebf48cd 100644 (file)
@@ -1,5 +1,8 @@
 2018-04-09  Jason Merrill  <jason@redhat.com>
 
+       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.
index 75e853a14288b6440a4aafe33ec3d38fad0eca80..f27b700a4349549ac1af1d2d9d16bf236473ca15 100644 (file)
@@ -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 (file)
index 0000000..e8042ac
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/85279
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct A
+{
+  void foo(decltype(T())::Y);  // { dg-error {decltype\(T\(\)\)::Y} }
+};