Lines Matching defs:Loc
59 bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc,
81 Diag(Loc, diag::err_auto_variable_cannot_appear_in_own_initializer)
89 Diag(Loc, diag::err_deleted_function_use);
103 EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass);
110 Diag(Loc, diag::err_unavailable) << D->getDeclName();
112 Diag(Loc, diag::warn_unavailable_fwdclass_message)
116 Diag(Loc, diag::err_unavailable_message)
126 Diag(Loc, diag::warn_used_but_marked_unused) << D->getDeclName();
152 void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc,
215 Diag(Loc, diag::warn_not_enough_argument) << D->getDeclName();
225 Diag(Loc, diag::warn_not_enough_argument) << D->getDeclName();
249 Diag(Loc, diag::warn_missing_sentinel) << isMethod;
1043 diagnoseUncapturableValueReference(Sema &S, SourceLocation loc,
1084 S.Diag(loc, diag::err_reference_to_local_var_in_enclosing_function)
1116 static CaptureResult shouldCaptureValueReference(Sema &S, SourceLocation loc,
1137 return diagnoseUncapturableValueReference(S, loc, var, DC);
1159 S.Diag(loc, diag::err_ref_vm_type);
1167 S.Diag(loc, diag::err_ref_array_type);
1172 S.MarkDeclarationReferenced(loc, var);
1196 Expr *declRef = new (S.Context) DeclRefExpr(var, type, VK_LValue, loc);
1201 loc, S.Owned(declRef));
1259 SourceLocation Loc,
1261 DeclarationNameInfo NameInfo(D->getDeclName(), Loc);
1788 SourceLocation Loc = Lookup.getNameLoc();
1817 return ExprError(Diag(Loc, diag::error_ivar_use_in_class_method)
1826 if (DiagnoseUseOfDecl(IV, Loc))
1832 Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName();
1850 MarkDeclarationReferenced(Loc, IV);
1852 ObjCIvarRefExpr(IV, IV->getType(), Loc,
1862 Diag(Loc, diag::warn_ivar_use_hidden) << IV->getDeclName();
2109 static bool CheckDeclInExpr(Sema &S, SourceLocation Loc, NamedDecl *D) {
2111 S.Diag(Loc, diag::err_unexpected_typedef) << D->getDeclName();
2116 S.Diag(Loc, diag::err_unexpected_interface) << D->getDeclName();
2121 S.Diag(Loc, diag::err_unexpected_namespace) << D->getDeclName();
2169 SourceLocation Loc = NameInfo.getLoc();
2170 if (CheckDeclInExpr(*this, Loc, D))
2176 Diag(Loc, diag::err_template_decl_ref)
2185 Diag(Loc, diag::err_ref_non_value)
2195 if (DiagnoseUseOfDecl(VD, Loc))
2374 ExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind) {
2391 Diag(Loc, diag::ext_predef_outside_function);
2405 return Owned(new (Context) PredefinedExpr(Loc, ResTy, IT));
2615 SourceLocation Loc,
2622 S.Diag(Loc, diag::err_vecstep_non_scalar_vector_type)
2633 SourceLocation Loc,
2640 S.Diag(Loc, diag::ext_sizeof_function_type) << ArgRange;
2646 S.Diag(Loc, diag::ext_sizeof_void_type) << TraitKind << ArgRange;
2654 SourceLocation Loc,
2659 S.Diag(Loc, diag::err_sizeof_nonfragile_interface)
2889 static QualType CheckRealImagOperand(Sema &S, ExprResult &V, SourceLocation Loc,
2914 return CheckRealImagOperand(S, V, Loc, isReal);
2918 S.Diag(Loc, diag::err_realimag_invalid_type) << V.get()->getType()
4336 SourceLocation loc = NullExpr->getExprLoc();
4337 if (!findMacroSpelling(loc, "NULL"))
4734 static void SuggestParentheses(Sema &Self, SourceLocation Loc,
4740 Self.Diag(Loc, Note)
4745 Self.Diag(Loc, Note) << ParenRange;
5094 Sema::CheckAssignmentConstraints(SourceLocation Loc,
5100 OpaqueValueExpr rhs(Loc, rhsType, VK_RValue);
5507 QualType Sema::InvalidOperands(SourceLocation Loc, ExprResult &lex, ExprResult &rex) {
5508 Diag(Loc, diag::err_typecheck_invalid_operands)
5515 SourceLocation Loc, bool isCompAssign) {
5587 Diag(Loc, diag::err_typecheck_vector_not_convertable)
5594 ExprResult &lex, ExprResult &rex, SourceLocation Loc, bool isCompAssign, bool isDiv) {
5596 return CheckVectorOperands(lex, rex, Loc, isCompAssign);
5604 return InvalidOperands(Loc, lex, rex);
5609 DiagRuntimeBehavior(Loc, rex.get(), PDiag(diag::warn_division_by_zero)
5616 ExprResult &lex, ExprResult &rex, SourceLocation Loc, bool isCompAssign) {
5620 return CheckVectorOperands(lex, rex, Loc, isCompAssign);
5621 return InvalidOperands(Loc, lex, rex);
5629 return InvalidOperands(Loc, lex, rex);
5633 DiagRuntimeBehavior(Loc, rex.get(), PDiag(diag::warn_remainder_by_zero)
5640 static void diagnoseArithmeticOnTwoVoidPointers(Sema &S, SourceLocation Loc,
5642 S.Diag(Loc, S.getLangOptions().CPlusPlus
5649 static void diagnoseArithmeticOnVoidPointer(Sema &S, SourceLocation Loc,
5651 S.Diag(Loc, S.getLangOptions().CPlusPlus
5658 static void diagnoseArithmeticOnTwoFunctionPointers(Sema &S, SourceLocation Loc,
5662 S.Diag(Loc, S.getLangOptions().CPlusPlus
5674 static void diagnoseArithmeticOnFunctionPointer(Sema &S, SourceLocation Loc,
5677 S.Diag(Loc, S.getLangOptions().CPlusPlus
5693 static bool checkArithmeticOpPointerOperand(Sema &S, SourceLocation Loc,
5699 diagnoseArithmeticOnVoidPointer(S, Loc, Operand);
5703 diagnoseArithmeticOnFunctionPointer(S, Loc, Operand);
5712 Loc, PointeeTy,
5730 static bool checkArithmeticBinOpPointerOperands(Sema &S, SourceLocation Loc,
5744 if (!isRHSVoidPtr) diagnoseArithmeticOnVoidPointer(S, Loc, LHS);
5745 else if (!isLHSVoidPtr) diagnoseArithmeticOnVoidPointer(S, Loc, RHS);
5746 else diagnoseArithmeticOnTwoVoidPointers(S, Loc, LHS, RHS);
5754 if (!isRHSFuncPtr) diagnoseArithmeticOnFunctionPointer(S, Loc, LHS);
5755 else if (!isLHSFuncPtr) diagnoseArithmeticOnFunctionPointer(S, Loc, RHS);
5756 else diagnoseArithmeticOnTwoFunctionPointers(S, Loc, LHS, RHS);
5769 Loc, PointeeTy,
5779 ExprResult &lex, ExprResult &rex, SourceLocation Loc, QualType* CompLHSTy) {
5781 QualType compType = CheckVectorOperands(lex, rex, Loc, CompLHSTy);
5804 if (!checkArithmeticOpPointerOperand(*this, Loc, PExp))
5811 Diag(Loc, diag::err_arithmetic_nonfragile_interface)
5829 return InvalidOperands(Loc, lex, rex);
5834 SourceLocation Loc, QualType* CompLHSTy) {
5836 QualType compType = CheckVectorOperands(lex, rex, Loc, CompLHSTy);
5860 Diag(Loc, diag::err_arithmetic_nonfragile_interface)
5867 if (!checkArithmeticOpPointerOperand(*this, Loc, lex.get()))
5881 Diag(Loc, diag::err_typecheck_sub_ptr_compatible)
5891 Diag(Loc, diag::err_typecheck_sub_ptr_compatible)
5898 if (!checkArithmeticBinOpPointerOperands(*this, Loc,
5907 return InvalidOperands(Loc, lex, rex);
5917 SourceLocation Loc, unsigned Opc,
5925 S.DiagRuntimeBehavior(Loc, rex.get(),
5933 S.DiagRuntimeBehavior(Loc, rex.get(),
5966 S.Diag(Loc, diag::warn_shift_result_sets_sign_bit)
5972 S.Diag(Loc, diag::warn_shift_result_gt_typewidth)
5978 QualType Sema::CheckShiftOperands(ExprResult &lex, ExprResult &rex, SourceLocation Loc,
5983 return InvalidOperands(Loc, lex, rex);
5989 return InvalidOperands(Loc, lex, rex);
5994 return CheckVectorOperands(lex, rex, Loc, isCompAssign);
6014 DiagnoseBadShiftValues(*this, lex, rex, Loc, Opc, LHSTy);
6031 QualType Sema::CheckCompareOperands(ExprResult &lex, ExprResult &rex, SourceLocation Loc,
6037 return CheckVectorCompareOperands(lex, rex, Loc, isRelational);
6055 Diag(Loc, diag::warn_comparison_of_mixed_enum_types)
6080 DiagRuntimeBehavior(Loc, 0, PDiag(diag::warn_comparison_always)
6102 DiagRuntimeBehavior(Loc, 0, PDiag(diag::warn_comparison_always)
6143 DiagRuntimeBehavior(Loc, 0,
6178 CheckFloatComparison(Loc, lex.get(), rex.get());
6208 Diag(Loc,
6231 QualType T = FindCompositePointerType(Loc, lex, rex,
6234 Diag(Loc, diag::err_typecheck_comparison_of_distinct_pointers)
6238 Diag(Loc,
6253 Diag(Loc, diag::ext_typecheck_ordered_comparison_of_function_pointers)
6261 Diag(Loc, diag::ext_typecheck_comparison_of_fptr_to_void)
6266 Diag(Loc, diag::ext_typecheck_comparison_of_distinct_pointers)
6320 QualType T = FindCompositePointerType(Loc, lex, rex,
6323 Diag(Loc, diag::err_typecheck_comparison_of_distinct_pointers)
6327 Diag(Loc,
6352 Diag(Loc, diag::err_typecheck_comparison_of_distinct_blocks)
6368 Diag(Loc, diag::err_typecheck_comparison_of_distinct_blocks)
6387 Diag(Loc, diag::ext_typecheck_comparison_of_distinct_pointers)
6398 Diag(Loc, diag::ext_typecheck_comparison_of_distinct_pointers)
6424 Diag(Loc, DiagID)
6451 return InvalidOperands(Loc, lex, rex);
6459 SourceLocation Loc,
6463 QualType vType = CheckVectorOperands(lex, rex, Loc, /*isCompAssign*/false);
6482 DiagRuntimeBehavior(Loc, 0,
6492 CheckFloatComparison(Loc, lex.get(), rex.get());
6514 ExprResult &lex, ExprResult &rex, SourceLocation Loc, bool isCompAssign) {
6518 return CheckVectorOperands(lex, rex, Loc, isCompAssign);
6520 return InvalidOperands(Loc, lex, rex);
6533 return InvalidOperands(Loc, lex, rex);
6537 ExprResult &lex, ExprResult &rex, SourceLocation Loc, unsigned Opc) {
6545 !Loc.isMacroID() && ActiveTemplateInstantiations.empty()) {
6554 Diag(Loc, diag::warn_logical_instead_of_bitwise)
6571 return InvalidOperands(Loc, lex, rex);
6584 return InvalidOperands(Loc, lex, rex);
6589 return InvalidOperands(Loc, lex, rex);
6652 static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) {
6653 SourceLocation OrigLoc = Loc;
6655 &Loc);
6694 if (Loc != OrigLoc)
6696 S.Diag(Loc, Diag) << E->getSourceRange() << Assign;
6725 return S.RequireCompleteType(Loc, E->getType(),
6749 if (Loc != OrigLoc)
6752 S.Diag(Loc, Diag) << E->getType() << E->getSourceRange() << Assign;
6754 S.Diag(Loc, Diag) << E->getSourceRange() << Assign;
6762 Loc,
6765 if (CheckForModifiableLvalue(LHS, Loc, *this))
6795 Diag(Loc, diag::err_assignment_requires_nonfragile_object)
6807 Loc.isFileID() && UO->getOperatorLoc().isFileID() &&
6809 Loc.getFileLocWithOffset(1) == UO->getOperatorLoc() &&
6812 Loc.getFileLocWithOffset(2) != UO->getSubExpr()->getLocStart() &&
6814 Diag(Loc, diag::warn_not_compound_assign)
6824 checkUnsafeExprAssigns(Loc, LHS, RHS.get());
6828 ConvTy = CheckAssignmentConstraints(Loc, LHSType, RHSType);
6831 if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType,
6852 SourceLocation Loc) {
6875 S.RequireCompleteType(Loc, RHS.get()->getType(), diag::err_incomplete_type);
8635 SourceLocation Loc,
8749 Diag(Loc, DiagKind) << FirstType << SecondType << Action
8866 /// \param Loc the location where the declaration was referenced.
8869 void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
8909 ExprEvalContexts.back().addReferencedDecl(Loc, D);
8924 DefineImplicitDefaultConstructor(Loc, Constructor);
8928 DefineImplicitCopyConstructor(Loc, Constructor);
8931 MarkVTableUsed(Loc, Constructor->getParent());
8934 DefineImplicitDestructor(Loc, Destructor);
8936 MarkVTableUsed(Loc, Destructor->getParent());
8941 DefineImplicitCopyAssignment(Loc, MethodDecl);
8943 MarkVTableUsed(Loc, MethodDecl->getParent());
8956 SpecInfo->setPointOfInstantiation(Loc);
8963 MSInfo->setPointOfInstantiation(Loc);
8973 Loc));
8975 PendingInstantiations.push_back(std::make_pair(Function, Loc));
8982 MarkDeclarationReferenced(Loc, *i);
8990 if (old.isInvalid()) old = Loc;
9005 MSInfo->setPointOfInstantiation(Loc);
9009 PendingInstantiations.push_back(std::make_pair(Var, Loc));
9020 if (old.isInvalid()) old = Loc;
9034 SourceLocation Loc;
9039 MarkReferencedDecls(Sema &S, SourceLocation Loc) : S(S), Loc(Loc) { }
9049 S.MarkDeclarationReferenced(Loc, Arg.getAsDecl());
9065 void Sema::MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T) {
9066 MarkReferencedDecls Marker(*this, Loc);
9150 bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *stmt,
9161 push_back(sema::PossiblyUnreachableDiag(PD, Loc, stmt));
9164 Diag(Loc, PD);
9169 ExprEvalContexts.back().addDiagnostic(Loc, PD);
9176 bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc,
9186 if (RequireCompleteType(Loc, ReturnType,
9201 SourceLocation Loc;
9227 Loc = Op->getOperatorLoc();
9234 Loc = Op->getOperatorLoc();
9240 Diag(Loc, diagnostic) << E->getSourceRange();
9244 Loc, diag::note_condition_assign_silence)
9249 Diag(Loc, diag::note_condition_or_assign_to_comparison)
9250 << FixItHint::CreateReplacement(Loc, "!=");
9252 Diag(Loc, diag::note_condition_assign_to_comparison)
9253 << FixItHint::CreateReplacement(Loc, "==");
9273 SourceLocation Loc = opE->getOperatorLoc();
9275 Diag(Loc, diag::warn_equality_with_extra_parens) << E->getSourceRange();
9276 Diag(Loc, diag::note_equality_comparison_silence)
9279 Diag(Loc, diag::note_equality_comparison_to_assign)
9280 << FixItHint::CreateReplacement(Loc, "=");
9284 ExprResult Sema::CheckBooleanCondition(Expr *E, SourceLocation Loc) {
9304 Diag(Loc, diag::err_typecheck_statement_requires_scalar)
9313 ExprResult Sema::ActOnBooleanCondition(Scope *S, SourceLocation Loc,
9318 return CheckBooleanCondition(Sub, Loc);
9680 SourceLocation loc;
9683 loc = ref->getLocation();
9686 loc = mem->getMemberLoc();
9690 loc = msg->getSelectorLoc();
9699 S.Diag(loc, diagID) << d << orig->getSourceRange();