From 41c6dcc7341db47e59e1cb3d60a08b420efd2bfc Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 22 Aug 2011 17:24:56 +0000 Subject: 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 --- clang/test/SemaCXX/references.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/test/SemaCXX/references.cpp') 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; -- cgit v1.2.3