diff options
Diffstat (limited to 'clang/test/SemaCXX/defaulted-ctor-loop.cpp')
-rw-r--r-- | clang/test/SemaCXX/defaulted-ctor-loop.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/defaulted-ctor-loop.cpp b/clang/test/SemaCXX/defaulted-ctor-loop.cpp new file mode 100644 index 0000000..6416336 --- /dev/null +++ b/clang/test/SemaCXX/defaulted-ctor-loop.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s + +// WARNING: This test may recurse infinitely if failing. + +struct foo; +struct bar { + bar(foo&); +}; +struct foo { + bar b; + foo() + : b(b) // expected-warning{{field is uninitialized}} + {} +}; |