Generate nuw GEPs for struct member accesses, as inbounds + non-negative
implies nuw.
Regression tests are updated using update scripts where possible, and by
find + replace where not.
This patch replaces member accesses to declaration references during template
instantiation if the context is the unevaluated context and the class does not
contain the declaration.
The replacement fixes the issue #58674. Unlike previous fixes such as D143840,
it checks the membership during instantiation rather than right after parsing,
so the check is more accurate and efficient.
This patch also includes cases that previous fixes had once failed on.
Differential Revision: https://reviews.llvm.org/D145491
This patch includes the commit 01adf96ebc86 and a fix of unhandled declaration
references.
When looking up base classes, Clang first checks whether a base class is a
template and takes the specialized template based on it. However, the base class
might be instantiated, and the above behavior can lose information.
This patch fixes the problem by first checking whether a base class is a record
declaration, so the instantiated one will be taken.
Differential Revision: https://reviews.llvm.org/D143840