Thoroughly check for a pointer dereference which yields a glvalue. Look
through casts, comma operators, conditional operators, paren
expressions, etc.
Details
Diff Detail
Event Timeline
lib/CodeGen/CGExprCXX.cpp | ||
---|---|---|
1618 | This doesn't handle ((T*)nullptr)[0] Its semantics are defined in terms of a desugaring to *((T*)nullptr + 0) ... so I suppose we should probably handle it here, but it's not entirely clear. | |
1619 | I think this will insert a null check for T *p; typeid( (const T&)(T)*p ) ... which doesn't seem strictly necessary (though superfluous null checks here seem pretty harmless). |
lib/CodeGen/CGExprCXX.cpp | ||
---|---|---|
1622 | Maybe add a test for the xvalue case; something like typeid((T&&)*(T*)nullptr) ? | |
1636 | How could this not be the case? Also, you have no test coverage for binary conditionals. | |
1652–1653 | Maybe extend this to say that it's not clear what this means, but we use the most generous interpretation. |
This doesn't handle
Its semantics are defined in terms of a desugaring to
... so I suppose we should probably handle it here, but it's not entirely clear.