From 20ba8012840b22ed10d2c13890a46f92a0c59002 Mon Sep 17 00:00:00 2001 From: arphaman Date: Sun, 15 Sep 2013 13:25:50 +0100 Subject: removed old assignment typechecking; use initialization typechecking for type constructors --- include/flang/Basic/DiagnosticSemaKinds.td | 4 ++-- include/flang/Sema/Sema.h | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/flang/Basic/DiagnosticSemaKinds.td b/include/flang/Basic/DiagnosticSemaKinds.td index 1cde03b208..2ded6c4136 100644 --- a/include/flang/Basic/DiagnosticSemaKinds.td +++ b/include/flang/Basic/DiagnosticSemaKinds.td @@ -51,8 +51,8 @@ def err_typecheck_passing_incompatible_named_args : Error< "passing %0 to parameter '%1' of incompatible type %2 (or parameter '%3' of type %4)">; def note_typecheck_passing_argument_to_param_here : Note< "passing argument to parameter %0 here">; -def note_typecheck_passing_argument_to_field_here : Note< - "passing argument to field %0 declared here">; +def note_typecheck_initializing_member_here : Note< + "initializing member %0 declared here">; def err_typecheck_arith_invalid_operands : Error< "invalid operands to an arithmetic binary expression (%0 and %1)">; diff --git a/include/flang/Sema/Sema.h b/include/flang/Sema/Sema.h index 0053f29d71..1d6c40929d 100644 --- a/include/flang/Sema/Sema.h +++ b/include/flang/Sema/Sema.h @@ -565,14 +565,20 @@ public: }; private: Type ActTy; + const Decl *D; public: AssignmentAction(Type Ty) - : ActTy(Ty) {} + : ActTy(Ty), D(nullptr) {} + AssignmentAction(Type Ty, const Decl *d) + : ActTy(Ty), D(d) {} Type getType() const { return ActTy; } + const Decl *getDecl() const { + return D; + } }; /// AssignConvertType - All of the 'assignment' semantic checks return this @@ -892,14 +898,6 @@ public: /// Returns true if the given character length can be applied to a declaration. bool CheckCharacterLengthDeclarationCompability(QualType T, VarDecl *VD); - - - /// Performs assignment typechecking. - ExprResult TypecheckAssignment(QualType LHSType, ExprResult RHS, - SourceLocation Loc = SourceLocation(), - SourceRange LHSRange = SourceRange(), - SourceRange RHSRange = SourceRange()); - /// Returns true if the subscript expression has the /// right amount of dimensions. bool CheckSubscriptExprDimensionCount(SourceLocation Loc, SourceLocation RParenLoc, -- cgit v1.2.1