Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Greg Clayton <gclayton <at> apple.com>
Subject: Re: invalid use of 'this' outside of a non-static member function
Newsgroups: gmane.comp.debugging.lldb.devel
Date: Wednesday 7th January 2015 18:49:44 UTC (over 3 years ago)
All expressions are compiled in C++ mode and thus the restriction. 

There are a few solutions:
1 - make expressions match the current language of the current frame. So if
your function was a C function, you will be restricted from using C++ in
your expression
2 - rename your "this" and benefit from the C++ abilities of the expression
parser 

I personally really like the ability to use "auto" and all of the C++11
constructs in any expression:

(lldb) expr for (auto x = 0; x < my_renamed_this; ++x) { ... }

So I see the problem with C expressions, but I would rather not limit you
from being able to access your C++ code from a C function by limiting the
language based on where you are stopped.

Greg

> On Jan 7, 2015, at 7:16 AM, mobi phil  wrote:
> 
> Hi,
> 
> The compiler accepted it, so IMHO LLDB should not complain about it.
> 
> I can rename this "this" inside a C function, but it is very likely that
other people would name a variable "this" inside C code.
> 
> 
> rgrds,
> mobi phil
> 
> 
> _______________________________________________
> lldb-dev mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
 
CD: 26ms