[PATCH] D18461: ObjCXX: Warn undeclared identifiers.
Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 25 11:49:01 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264444: [ObjCXX] Warn undeclared identifiers. (authored by mren).
Changed prior to commit:
http://reviews.llvm.org/D18461?vs=51598&id=51667#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18461
Files:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/test/SemaObjCXX/typo-correction.mm
Index: cfe/trunk/include/clang/AST/Stmt.h
===================================================================
--- cfe/trunk/include/clang/AST/Stmt.h
+++ cfe/trunk/include/clang/AST/Stmt.h
@@ -115,6 +115,7 @@
friend class OverloadExpr; // ctor
friend class PseudoObjectExpr; // ctor
friend class AtomicExpr; // ctor
+ friend class OpaqueValueExpr; // ctor
unsigned : NumStmtBits;
unsigned ValueKind : 2;
Index: cfe/trunk/include/clang/AST/Expr.h
===================================================================
--- cfe/trunk/include/clang/AST/Expr.h
+++ cfe/trunk/include/clang/AST/Expr.h
@@ -847,10 +847,12 @@
ExprObjectKind OK = OK_Ordinary,
Expr *SourceExpr = nullptr)
: Expr(OpaqueValueExprClass, T, VK, OK,
- T->isDependentType(),
+ T->isDependentType() ||
+ (SourceExpr && SourceExpr->isTypeDependent()),
T->isDependentType() ||
(SourceExpr && SourceExpr->isValueDependent()),
- T->isInstantiationDependentType(),
+ T->isInstantiationDependentType() ||
+ (SourceExpr && SourceExpr->isInstantiationDependent()),
false),
SourceExpr(SourceExpr), Loc(Loc) {
}
Index: cfe/trunk/test/SemaObjCXX/typo-correction.mm
===================================================================
--- cfe/trunk/test/SemaObjCXX/typo-correction.mm
+++ cfe/trunk/test/SemaObjCXX/typo-correction.mm
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+class ClassA {};
+
+class ClassB {
+public:
+ ClassB(ClassA* parent=0);
+ ~ClassB();
+};
+
+ at interface NSObject
+ at end
+
+ at interface InterfaceA : NSObject
+ at property(nonatomic, assign) ClassA *m_prop1; // expected-note {{here}}
+ at property(nonatomic, assign) ClassB *m_prop2;
+ at end
+
+ at implementation InterfaceA
+- (id)test {
+ self.m_prop2 = new ClassB(m_prop1); // expected-error {{use of undeclared identifier 'm_prop1'; did you mean '_m_prop1'?}}
+}
+ at end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18461.51667.patch
Type: text/x-patch
Size: 1989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160325/13e97b2d/attachment.bin>
More information about the cfe-commits
mailing list