From 00709c08e81cf0c191e1bd5cd791cd09f26cf61c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 21 Nov 2017 15:36:25 +0000 Subject: [PATCH] re PR c++/83020 (('17) Class template constructor call skipped with no error when substitution fails in default argument) 2017-11-21 Paolo Carlini PR c++/83020 * g++.dg/cpp1z/pr83020.C: New. From-SVN: r255006 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1z/pr83020.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/pr83020.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b508745c5ad..8a376ff1702 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-21 Paolo Carlini + + PR c++/83020 + * g++.dg/cpp1z/pr83020.C: New. + 2017-11-21 Jakub Jelinek PR target/82880 diff --git a/gcc/testsuite/g++.dg/cpp1z/pr83020.C b/gcc/testsuite/g++.dg/cpp1z/pr83020.C new file mode 100644 index 00000000000..43a7e382d39 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/pr83020.C @@ -0,0 +1,16 @@ +// PR c++/83020 +// { dg-options -std=c++17 } + +struct NoDefault { + int val = 1234; + NoDefault(int v) : val(v) {} +}; +template +struct Whoops { + const char *str; + T obj; + Whoops(const char *s, T v = T()) : str(s), obj(v) {} // { dg-error "no matching" } +}; +const char *test() { + return Whoops("hi").str; +} -- 2.30.2