summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2015-01-07 21:16:39 +0000
committerKaelyn Takata <rikka@google.com>2015-01-07 21:16:39 +0000
commit42118a9524a5c7183bf14b458f0cd28f536d2d05 (patch)
tree81f4b6892fd5191dabc08bda6bd0029f9ab701be /clang/lib/Sema/SemaDecl.cpp
parent03e64766935d586eb63caee3fc3b200ca4cd55c9 (diff)
downloadbcm5719-llvm-42118a9524a5c7183bf14b458f0cd28f536d2d05.tar.gz
bcm5719-llvm-42118a9524a5c7183bf14b458f0cd28f536d2d05.zip
Handle OpaqueValueExprs more intelligently in the TransformTypos tree
transform. Also diagnose typos in the initializer of an invalid C++ declaration. Both issues were hit using the same line of test code, depending on whether the code was treated as C or C++. Fixes PR22092. llvm-svn: 225389
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 7264d82774c..3af60cf2992 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8574,8 +8574,10 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
bool DirectInit, bool TypeMayContainAuto) {
// If there is no declaration, there was an error parsing it. Just ignore
// the initializer.
- if (!RealDecl || RealDecl->isInvalidDecl())
+ if (!RealDecl || RealDecl->isInvalidDecl()) {
+ CorrectDelayedTyposInExpr(Init);
return;
+ }
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(RealDecl)) {
// With declarators parsed the way they are, the parser cannot
OpenPOWER on IntegriCloud