diff options
Diffstat (limited to 'test/Analysis/initializer.cpp')
-rw-r--r-- | test/Analysis/initializer.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Analysis/initializer.cpp b/test/Analysis/initializer.cpp index d4f336977e..ab2eb90143 100644 --- a/test/Analysis/initializer.cpp +++ b/test/Analysis/initializer.cpp @@ -80,3 +80,33 @@ class StringWrapper { public: StringWrapper(const char *input) : str(strdup(input)) {} // no-warning }; + + +// PR15070 - Constructing a type containing a non-POD array mistakenly +// tried to perform a bind instead of relying on the CXXConstructExpr, +// which caused a cast<> failure in RegionStore. +namespace DefaultConstructorWithCleanups { + class Element { + public: + int value; + + class Helper { + public: + ~Helper(); + }; + Element(Helper h = Helper()); + }; + class Wrapper { + public: + Element arr[2]; + + Wrapper(); + }; + + Wrapper::Wrapper() /* initializers synthesized */ {} + + int test() { + Wrapper w; + return w.arr[0].value; // no-warning + } +} |