summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/references.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-08-22 17:24:56 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-08-22 17:24:56 +0000
commit41c6dcc7341db47e59e1cb3d60a08b420efd2bfc (patch)
tree449c505cc86e726c737059b1ca34802ed77d9e14 /clang/test/SemaCXX/references.cpp
parent899c36525706126b008d1241c3a568783e9849e6 (diff)
downloadbcm5719-llvm-41c6dcc7341db47e59e1cb3d60a08b420efd2bfc.tar.gz
bcm5719-llvm-41c6dcc7341db47e59e1cb3d60a08b420efd2bfc.zip
Fix a crash-on-valid that has been here for a very long time:
const int &x = x; This crashed by inifinetly recursing within the lvalue evaluation routine. I've added a (somewhat) braindead way of preventing this recursion. If folks have better suggestions for how to avoid it I'm all ears. That said, we have some work to do. This doesn't trigger a single warning for uninitialized, self-initialized or otherwise completely wrong code. In some senses, the crash was almost better. llvm-svn: 138239
Diffstat (limited to 'clang/test/SemaCXX/references.cpp')
-rw-r--r--clang/test/SemaCXX/references.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/references.cpp b/clang/test/SemaCXX/references.cpp
index ab44e78453b..70d3799a0ea 100644
--- a/clang/test/SemaCXX/references.cpp
+++ b/clang/test/SemaCXX/references.cpp
@@ -134,3 +134,6 @@ namespace PR7149 {
namespace PR8608 {
bool& f(unsigned char& c) { return (bool&)c; }
}
+
+// The following crashed trying to recursively evaluate the LValue.
+const int &do_not_crash = do_not_crash;
OpenPOWER on IntegriCloud