From 173a960ac907a353ac9de8bca9948ef9d41a7ec2 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 18 Oct 2017 07:24:50 +0000 Subject: [PATCH] re PR c++/79474 (Multiple definitions of user-defined conversion operator cause ICE (internal compiler error)) 2017-10-18 Paolo Carlini PR c++/79474 * g++.dg/cpp1y/auto-fn44.C: New. From-SVN: r253841 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1y/auto-fn44.C | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/auto-fn44.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b731059a8cb..d5fc8d8e44a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-18 Paolo Carlini + + PR c++/79474 + * g++.dg/cpp1y/auto-fn44.C: New. + 2017-10-17 Eric Botcazou * gcc.dg/attr-alloc_size-11.c: UnXFAIL for visium-*-*. diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C new file mode 100644 index 00000000000..e35215d64c7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn44.C @@ -0,0 +1,12 @@ +// PR c++/79474 +// { dg-do compile { target c++14 } } + +struct Funject +{ + operator auto() { return +[](bool b) {return b;}; } + operator auto() { return +[](bool b, bool, bool) {return b;}; } // { dg-error "cannot be overloaded" } +}; + +Funject fun; +auto bbb = fun(true); +auto bbbb = fun(true, false, true); // { dg-error "no match" } -- 2.30.2