diff options
-rw-r--r-- | clang/include/clang/AST/Expr.h | 6 | ||||
-rw-r--r-- | clang/include/clang/AST/Stmt.h | 1 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/typo-correction.mm | 23 |
3 files changed, 28 insertions, 2 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index bc5dab754c6..6b14c60e951 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -847,10 +847,12 @@ public: 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) { } diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index d3950e92cf0..b6ed6c547cc 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -115,6 +115,7 @@ protected: friend class OverloadExpr; // ctor friend class PseudoObjectExpr; // ctor friend class AtomicExpr; // ctor + friend class OpaqueValueExpr; // ctor unsigned : NumStmtBits; unsigned ValueKind : 2; diff --git a/clang/test/SemaObjCXX/typo-correction.mm b/clang/test/SemaObjCXX/typo-correction.mm new file mode 100644 index 00000000000..a34a7901e8e --- /dev/null +++ b/clang/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(); +}; + +@interface NSObject +@end + +@interface InterfaceA : NSObject +@property(nonatomic, assign) ClassA *m_prop1; // expected-note {{here}} +@property(nonatomic, assign) ClassB *m_prop2; +@end + +@implementation InterfaceA +- (id)test { + self.m_prop2 = new ClassB(m_prop1); // expected-error {{use of undeclared identifier 'm_prop1'; did you mean '_m_prop1'?}} +} +@end |