mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
testsuite: add infinite recursion test case [PR63388]
gcc/testsuite/ChangeLog: PR c++/63388 * g++.dg/analyzer/infinite-recursion-pr63388.C: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This commit is contained in:
parent
6f4977ee54
commit
85736ba8e1
21
gcc/testsuite/g++.dg/analyzer/infinite-recursion-pr63388.C
Normal file
21
gcc/testsuite/g++.dg/analyzer/infinite-recursion-pr63388.C
Normal file
@ -0,0 +1,21 @@
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
namespace std
|
||||
{
|
||||
class ostream;
|
||||
extern ostream cout;
|
||||
}
|
||||
|
||||
enum class Month {jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, Month m)
|
||||
{
|
||||
return os << m; // { dg-warning "infinite recursion" }
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Month m = Month::may;
|
||||
std::cout << m;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user