diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-05-02 18:35:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-05-02 18:35:56 +0000 |
commit | 39b60dc786950e553f5e12fa0e692a33f650a568 (patch) | |
tree | 6f13000486e889270a0d451b1fc7dc798b523450 /test/CXX | |
parent | db3910be2e30b3fa00474f0e1c0780f544469dee (diff) |
Fix crasher when the range in a C++ range-for loop has an ill-formed initializer.
Fixes <rdar://problem/13712739>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp b/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp index 3952afdeff..b159a15b8d 100644 --- a/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp +++ b/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp @@ -242,3 +242,13 @@ void example() { for (int &x : array) x *= 2; } + +namespace rdar13712739 { + template<typename T> + void foo(const T& t) { + auto &x = t.get(); // expected-error{{member reference base type 'const int' is not a structure or union}} + for (auto &blah : x) { } + } + + template void foo(const int&); // expected-note{{in instantiation of function template specialization}} +} |