re PR c++/83020 (('17) Class template constructor call skipped with no error when substitution fails in default argument)

2017-11-21  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/83020
	* g++.dg/cpp1z/pr83020.C: New.

From-SVN: r255006
This commit is contained in:
Paolo Carlini 2017-11-21 15:36:25 +00:00 committed by Paolo Carlini
parent 769ae3bb49
commit 00709c08e8
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2017-11-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/83020
* g++.dg/cpp1z/pr83020.C: New.
2017-11-21 Jakub Jelinek <jakub@redhat.com>
PR target/82880

View file

@ -0,0 +1,16 @@
// PR c++/83020
// { dg-options -std=c++17 }
struct NoDefault {
int val = 1234;
NoDefault(int v) : val(v) {}
};
template <class T>
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<NoDefault>("hi").str;
}