Open Quuxplusone opened 6 years ago
Bugzilla Link | PR36451 |
Status | NEW |
Importance | P enhancement |
Reported by | Dmitry Antipov (dmantipov@yandex.ru) |
Reported on | 2018-02-20 04:11:20 -0800 |
Last modified on | 2018-02-20 08:53:00 -0800 |
Version | 6.0 |
Hardware | PC Linux |
CC | jingham@apple.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
This is a common source of confusion. The expression parser parses expressions purely "as if executed in the current frame". In T0::oops, "this" is a T0, not a T2 and has no "z".
However, once we've gotten the result of the expression, the ValueObject printer can figure out the dynamic type of the object and print the full dynamic value. You can turn this off if you wish (settings set target.prefer-dynamic-value 0). We had this off by default at first lest it be confusing, but people really liked seeing the dynamic value of the result, so we made the default 1 a long time ago.
It would be great to teach the expression parser to fetch dynamic types when possible, but my guess is that's not going to be an easy thing to do. Anyway, that's the bug here.