re PR c++/63506 (GCC deduces wrong return type of operator*() inside template functions)
2015-12-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/63506 * g++.dg/cpp0x/pr63506-1.C: New. * g++.dg/cpp0x/pr63506-2.C: Likewise. From-SVN: r231646
This commit is contained in:
parent
2764999bbd
commit
293b1f44fa
@ -1,3 +1,9 @@
|
||||
2015-12-15 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/63506
|
||||
* g++.dg/cpp0x/pr63506-1.C: New.
|
||||
* g++.dg/cpp0x/pr63506-2.C: Likewise.
|
||||
|
||||
2015-12-15 Olivier Hainque <hainque@adacore.com>
|
||||
|
||||
* gcc.target/visium/block_move.c: Skip for -mcpu=gr5.
|
||||
|
24
gcc/testsuite/g++.dg/cpp0x/pr63506-1.C
Normal file
24
gcc/testsuite/g++.dg/cpp0x/pr63506-1.C
Normal file
@ -0,0 +1,24 @@
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct proxy {};
|
||||
|
||||
struct iterator
|
||||
{
|
||||
proxy operator*() { return proxy(); }
|
||||
};
|
||||
|
||||
//#define DEACTIVATE
|
||||
|
||||
#ifndef DEACTIVATE
|
||||
template<typename T = int>
|
||||
#endif
|
||||
void foo(iterator it)
|
||||
{
|
||||
auto&& x = *it;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
iterator it;
|
||||
foo(it);
|
||||
}
|
27
gcc/testsuite/g++.dg/cpp0x/pr63506-2.C
Normal file
27
gcc/testsuite/g++.dg/cpp0x/pr63506-2.C
Normal file
@ -0,0 +1,27 @@
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct proxy {};
|
||||
|
||||
struct iterator
|
||||
{
|
||||
proxy operator*() { return proxy(); }
|
||||
|
||||
proxy operator[](int i) { return proxy(); }
|
||||
};
|
||||
|
||||
//#define DEACTIVATE
|
||||
|
||||
#ifndef DEACTIVATE
|
||||
template<typename T = int>
|
||||
#endif
|
||||
void foo(iterator it)
|
||||
{
|
||||
auto&& x = *it;
|
||||
auto&& y = it[1];
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
iterator it;
|
||||
foo(it);
|
||||
}
|
Loading…
Reference in New Issue
Block a user