re PR c++/66197 (c++1z generic function wrong type for auto)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 4 Aug 2015 17:22:05 +0000 (17:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 4 Aug 2015 17:22:05 +0000 (17:22 +0000)
2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/66197
* g++.dg/cpp1z/abbrev2.C: New.

2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/cpp1z/static_assert-nomsg.C: Fix DejaGnu directive.

From-SVN: r226591

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/abbrev2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C

index 7f442854815db2f6bcb5296cddbb7dd895cada96..8471c040c661b3b46d9a79ee59156824d492bb40 100644 (file)
@@ -1,3 +1,12 @@
+2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/66197
+       * g++.dg/cpp1z/abbrev2.C: New.
+
+2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * g++.dg/cpp1z/static_assert-nomsg.C: Fix DejaGnu directive.
+
 2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/66392
diff --git a/gcc/testsuite/g++.dg/cpp1z/abbrev2.C b/gcc/testsuite/g++.dg/cpp1z/abbrev2.C
new file mode 100644 (file)
index 0000000..41d4bb1
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/66197
+// { dg-do run }
+// { dg-options "-std=c++1z" }
+
+extern "C" void abort();
+
+auto add_1(auto a, auto b) { return a + b; }
+auto add_2 = [](auto a, auto b) { return a + b; };
+
+int main()
+{
+  if (add_1(3.5, 4) != 7.5
+      || add_1(3, 4.5) != 7.5
+      || add_2(3.5, 4) != 7.5
+      || add_2(3, 4.5) != 7.5)
+    abort();
+}
index 3d12e18467594ebf567e0ce845b352ab3850eb34..8a2054e2d6b4f816a912151ae47c7ed423377ff2 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-do compile { target c++1z } }
+// { dg-options "-std=c++1z" }
 
 template<typename T>
   struct is_float