]> granicus.if.org Git - clang/commit
Bail out if we try to build a DeclRefExpr naming an invalid declaration.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Jan 2017 23:14:16 +0000 (23:14 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Jan 2017 23:14:16 +0000 (23:14 +0000)
commit809bd28961fc9ad33bf93f32c6b3546ad38bfeb0
tree2295584fe284932bdb9160c9ea0fe7d9b8fcc126
parent5465b0d08829d04fe61f7aa142707fc020d35062
Bail out if we try to build a DeclRefExpr naming an invalid declaration.

Most code paths would already bail out in this case, but certain paths,
particularly overload resolution and typo correction, would not. Carrying on
with an invalid declaration could in some cases result in crashes due to
downstream code relying on declaration invariants that are not necessarily
met for invalid declarations, and in other cases just resulted in undesirable
follow-on diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291030 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/constant-expression-cxx11.cpp
test/SemaCXX/conversion-function.cpp
test/SemaCXX/cxx1z-decomposition.cpp
test/SemaCXX/type-definition-in-specifier.cpp