re PR c++/59361 (cannot expand parenthesized pack expression)
authorAndrew Sutton <andrew.n.sutton@gmail.com>
Wed, 9 Jul 2014 08:32:43 +0000 (08:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 9 Jul 2014 08:32:43 +0000 (08:32 +0000)
/cp
2014-07-09  Andrew Sutton  <andrew.n.sutton@gmail.com>
    Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59361
* parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
CPP_ELLIPSIS too.

/testsuite
2014-07-09  Andrew Sutton  <andrew.n.sutton@gmail.com>
    Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59361
* g++.dg/cpp0x/vt-59361.C: New.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r212386

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/vt-59361.C [new file with mode: 0644]

index dc56de6..f1832ce 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-09  Andrew Sutton  <andrew.n.sutton@gmail.com>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/59361
+       * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
+       CPP_ELLIPSIS too.
+
 2014-07-07  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * class.c (check_for_override): Wrap the 'final' and 'override'
index 8ff57c7..72f987e 100644 (file)
@@ -7666,6 +7666,7 @@ cp_parser_tokens_start_cast_expression (cp_parser *parser)
     case CPP_OR:
     case CPP_OR_OR:
     case CPP_EOF:
+    case CPP_ELLIPSIS:
       return 0;
 
     case CPP_OPEN_PAREN:
index 98342bb..8db3192 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-09  Andrew Sutton  <andrew.n.sutton@gmail.com>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/59361
+       * g++.dg/cpp0x/vt-59361.C: New.
+
 2014-07-08  Sriraman Tallam  <tmsriram@google.com>
 
        PR target/61599
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-59361.C b/gcc/testsuite/g++.dg/cpp0x/vt-59361.C
new file mode 100644 (file)
index 0000000..519ae35
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/59361
+// { dg-do compile { target c++11 } }
+
+template<bool ...Bs>
+struct and_ 
+{
+  constexpr static bool value{true};
+};
+
+template<typename T>
+struct true_
+{
+  constexpr operator bool() const { return true; }
+};
+
+template<typename ...Ts>
+constexpr bool foo(Ts...)
+{
+  return and_<(true_<Ts>())...>::value;
+}