re PR c++/80296 (Broken diagnostic 'unary_plus_expr' not supported by expression)
authorVolker Reichelt <v.reichelt@netcologne.de>
Tue, 4 Apr 2017 16:30:44 +0000 (16:30 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Tue, 4 Apr 2017 16:30:44 +0000 (16:30 +0000)
        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
gcc/cp/cxx-pretty-print.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C [new file with mode: 0644]

index a28dcb5c6386b7a5ac03b8321544cc5b47272893..6cacac1552587d02e231402151e47e8031ad47a3 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
+
+       PR c++/80296
+       * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
+       UNARY_PLUS_EXPR case.
+
 2017-04-03  Jason Merrill  <jason@redhat.com>
 
        * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
index 470d124102dcae05fd370b06b85482013ff7b34c..f76c30a339049fa0a0ac9e61e783d8ad10307339 100644 (file)
@@ -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;
 
index 0d5f12853d96b0952d19f8ed9ca7381390e01daf..9c1a764a7eff1fdfbd7419609096468ba4ee383c 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
+
+       PR c++/80296
+       * g++.dg/cpp0x/alias-decl-80296.C: New test.
+
 2017-04-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        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 (file)
index 0000000..8664387
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-do compile { target c++11 } }
+// { dg-bogus "not supported by" "" { target *-*-* } 0 }
+
+template <int...> struct A {};
+
+template <int... N> using B = A<+N...>;
+
+B<int> b; // { dg-error "type/value mismatch" }
+          // { dg-message "expected a constant" "expected" { target *-*-* } 8 }