re PR c++/80873 (ICE in tsubst_copy when trying to use an overloaded function without a definition in a lambda)
2017-10-13 Paolo Carlini <paolo.carlini@oracle.com> PR c++/80873 * g++.dg/cpp1y/auto-fn41.C: New. * g++.dg/cpp1y/auto-fn42.C: Likewise. From-SVN: r253733
This commit is contained in:
parent
96ec425f5d
commit
8de7190350
@ -1,3 +1,9 @@
|
||||
2017-10-13 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/80873
|
||||
* g++.dg/cpp1y/auto-fn41.C: New.
|
||||
* g++.dg/cpp1y/auto-fn42.C: Likewise.
|
||||
|
||||
2017-10-13 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* g++.dg/cpp0x/udlit-extern-c.C: New test case.
|
||||
|
23
gcc/testsuite/g++.dg/cpp1y/auto-fn41.C
Normal file
23
gcc/testsuite/g++.dg/cpp1y/auto-fn41.C
Normal file
@ -0,0 +1,23 @@
|
||||
// PR c++/80873
|
||||
// { dg-do compile { target c++14 } }
|
||||
|
||||
struct S {};
|
||||
|
||||
auto overloaded(S &);
|
||||
|
||||
template <typename T>
|
||||
int overloaded(T &) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
auto returns_lambda(T ¶m) {
|
||||
return [&] {
|
||||
overloaded(param); // { dg-error "before deduction" }
|
||||
};
|
||||
}
|
||||
|
||||
int main() {
|
||||
S s;
|
||||
returns_lambda(s);
|
||||
}
|
21
gcc/testsuite/g++.dg/cpp1y/auto-fn42.C
Normal file
21
gcc/testsuite/g++.dg/cpp1y/auto-fn42.C
Normal file
@ -0,0 +1,21 @@
|
||||
// PR c++/80873
|
||||
// { dg-do compile { target c++14 } }
|
||||
|
||||
struct Buffer {};
|
||||
|
||||
auto parse(Buffer b);
|
||||
template <typename T> void parse(T target);
|
||||
|
||||
template <typename T>
|
||||
auto field(T target) {
|
||||
return [&] {
|
||||
parse(target);
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void parse(T target) {}
|
||||
|
||||
auto parse(Buffer b) {
|
||||
field(0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user