Refactor CompareReferenceRelationship and its callers in preparation for
authorRichard Smith <richard@metafoo.co.uk>
Wed, 18 Dec 2019 22:01:40 +0000 (14:01 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Wed, 18 Dec 2019 22:05:57 +0000 (14:05 -0800)
commit3ced23976aa8a86a17017c87821c873b4ca80bc2
tree1a42f80c2dee147ac0b98dccbd27eae4143da3c8
parenta6d57a8cd4cfa2a8395eaa6599fc12f7509f98f0
Refactor CompareReferenceRelationship and its callers in preparation for
implementing the resolution of CWG2352.

No functionality change, except that we now convert the referent of a
reference binding to the underlying type of the reference in more cases;
we used to happen to preserve the type sugar from the referent if the
only type change was in the cv-qualifiers.

This exposed a bug in how we generate code for trivial assignment
operators: if the type sugar (particularly the may_alias attribute)
got lost during reference binding, we'd use the "wrong" TBAA information
for the load during the assignment.
clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGExprCXX.cpp
clang/lib/Sema/SemaCast.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/AST/ast-dump-expr-json.cpp
clang/test/Index/print-type.cpp