From c0ea338bd2765c1af808a96e72a3928a52e4f558 Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Tue, 4 Apr 2017 16:30:44 +0000 Subject: [PATCH] re PR c++/80296 (Broken diagnostic 'unary_plus_expr' not supported by expression) PR c++/80296 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add UNARY_PLUS_EXPR case. * g++.dg/cpp0x/alias-decl-80296.C: New test. From-SVN: r246683 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/cxx-pretty-print.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C | 9 +++++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a28dcb5c638..6cacac15525 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-04-04 Volker Reichelt + + PR c++/80296 + * cxx-pretty-print.c (cxx_pretty_printer::expression): Add + UNARY_PLUS_EXPR case. + 2017-04-03 Jason Merrill * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO. diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 470d124102d..f76c30a3390 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -1112,6 +1112,7 @@ cxx_pretty_printer::expression (tree t) case SIZEOF_EXPR: case ALIGNOF_EXPR: case NOEXCEPT_EXPR: + case UNARY_PLUS_EXPR: unary_expression (t); break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d5f12853d9..9c1a764a7ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-04 Volker Reichelt + + PR c++/80296 + * g++.dg/cpp0x/alias-decl-80296.C: New test. + 2017-04-04 Thomas Preud'homme PR target/80307 diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C new file mode 100644 index 00000000000..86643876ff9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C @@ -0,0 +1,9 @@ +// { dg-do compile { target c++11 } } +// { dg-bogus "not supported by" "" { target *-*-* } 0 } + +template struct A {}; + +template using B = A<+N...>; + +B b; // { dg-error "type/value mismatch" } + // { dg-message "expected a constant" "expected" { target *-*-* } 8 } -- 2.30.2