[CFG] Provide construction contexts for temporaries bound to const references.
authorArtem Dergachev <artem.dergachev@gmail.com>
Sat, 24 Feb 2018 02:07:50 +0000 (02:07 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Sat, 24 Feb 2018 02:07:50 +0000 (02:07 +0000)
commit8cc55e9f16ddc19186dd593d2b69b6b43e04d6ac
tree15eee642d1cde8624b81659efcad6408a02d88b9
parentceb7d91a484982cfca84c102cfddb90b3963c46e
[CFG] Provide construction contexts for temporaries bound to const references.

In order to bind a temporary to a const lvalue reference, a no-op cast is added
to make the temporary itself const, and only then the reference is taken
(materialized). Skip the no-op cast when looking for the construction context.

Differential Revision: https://reviews.llvm.org/D43481

llvm-svn: 326016
clang/lib/Analysis/CFG.cpp
clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
clang/test/Analysis/cfg-rich-constructors.cpp
clang/test/Analysis/temp-obj-dtors-cfg-output.cpp