• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Sema/

Lines Matching refs:Loc

88 static void DiagnoseUnusedOfDecl(Sema &S, NamedDecl *D, SourceLocation Loc) {
97 S.Diag(Loc, diag::warn_used_but_marked_unused) << D->getDeclName();
145 SourceLocation Loc) {
173 bool DowngradeWarning = S.getSourceManager().isInMainFile(Loc);
177 S.Diag(Loc, DowngradeWarning ? diag::ext_internal_in_extern_inline_quiet
215 SourceLocation Loc = Locs.front();
234 Diag(Loc, diag::ext_main_used);
236 diagnoseUnavailableAlignedAllocation(*cast<FunctionDecl>(D), Loc);
242 Diag(Loc, diag::err_binding_cannot_appear_in_own_initializer)
245 Diag(Loc, diag::err_auto_variable_cannot_appear_in_own_initializer)
256 Diag(Loc, diag::err_deleted_inherited_ctor_use)
260 Diag(Loc, diag::err_deleted_function_use);
275 if (CheckFunctionConstraints(FD, Satisfaction, Loc))
280 Diag(Loc,
291 DeduceReturnType(FD, Loc))
294 if (getLangOpts().CUDA && !CheckCUDACall(Loc, FD))
297 if (getLangOpts().SYCLIsDevice && !checkSYCLDeviceFunction(Loc, FD))
307 Diag(Loc, diag::warn_cxx17_compat_lambda_def_ctor_assign)
319 if (diagnoseArgIndependentDiagnoseIfAttrs(ObjCPDecl, Loc))
321 } else if (diagnoseArgIndependentDiagnoseIfAttrs(D, Loc)) {
332 Diag(Loc, diag::err_omp_wrong_var_in_declare_reduction)
345 Diag(Loc, diag::err_omp_declare_mapper_wrong_var)
354 DiagnoseUnusedOfDecl(*this, D, Loc);
356 diagnoseUseOfInternalDeclInInlineFunction(*this, D, Loc);
360 checkDeviceDecl(VD, Loc);
373 Diag(Loc, diag::err_requires_expr_parameter_referenced_in_evaluated_context)
386 void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc,
442 Diag(Loc, diag::warn_not_enough_argument) << D->getDeclName();
469 Diag(Loc, diag::warn_missing_sentinel) << int(calleeType);
1401 SourceLocation Loc,
1416 S.Diag(Loc, S.getLangOpts().CPlusPlus20
1449 S.Diag(Loc, DiagID) << LHS->getSourceRange() << RHS->getSourceRange()
1459 SourceLocation Loc,
1461 checkEnumArithmeticConversions(*this, LHS.get(), RHS.get(), Loc, ACK);
1900 SourceLocation Loc,
1902 DeclarationNameInfo NameInfo(D->getDeclName(), Loc);
2283 SourceLocation Loc = NameInfo.getLoc();
2284 auto DB = S.Diag(Loc, diag::ext_undeclared_unqual_id_with_dependent_base);
2288 DB << FixItHint::CreateInsertion(Loc, "this->");
2300 SS.MakeTrivial(Context, NNS, SourceRange(Loc, Loc));
2592 SourceLocation Loc = SS.getBeginLoc();
2593 auto D = Diag(Loc, DiagID);
2595 << SourceRange(Loc, NameInfo.getEndLoc());
2603 D << FixItHint::CreateInsertion(Loc, "typename ");
2640 SourceLocation Loc = Lookup.getNameLoc();
2674 Diag(Loc, diag::err_ivar_use_in_class_method) << IV->getDeclName();
2682 Diag(Loc, diag::err_private_ivar_access) << IV->getDeclName();
2694 Diag(Loc, diag::warn_ivar_use_hidden) << IV->getDeclName();
2702 Diag(Loc, diag::err_ivar_use_in_class_method) << IV->getDeclName();
2711 ExprResult Sema::BuildIvarRefExpr(Scope *S, SourceLocation Loc,
2726 if (DiagnoseUseOfDecl(IV, Loc))
2748 MarkAnyDeclReferenced(Loc, IV, true);
2753 Diag(Loc, diag::warn_direct_ivar_access) << IV->getDeclName();
2756 ObjCIvarRefExpr(IV, IV->getUsageType(SelfExpr.get()->getType()), Loc,
2761 !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, Loc))
2766 ImplicitlyRetainedSelfLocs.push_back({Loc, BD});
3036 static bool CheckDeclInExpr(Sema &S, SourceLocation Loc, NamedDecl *D) {
3041 S.Diag(Loc, diag::err_unexpected_typedef) << D->getDeclName();
3046 S.Diag(Loc, diag::err_unexpected_interface) << D->getDeclName();
3051 S.Diag(Loc, diag::err_unexpected_namespace) << D->getDeclName();
3114 SourceLocation Loc = NameInfo.getLoc();
3115 if (CheckDeclInExpr(*this, Loc, D))
3121 diagnoseMissingTemplateArguments(TemplateName(Template), Loc);
3128 Diag(Loc, diag::err_ref_non_value)
3138 if (DiagnoseUseOfDecl(VD, Loc))
3242 QualType CapturedType = getCapturedDeclRefType(cast<VarDecl>(VD), Loc);
3260 diagnoseUncapturableValueReference(*this, Loc, BD, CurContext);
3359 ExprResult Sema::BuildPredefinedExpr(SourceLocation Loc,
3373 Diag(Loc, diag::ext_predef_outside_function);
3398 /*Pascal*/ false, ResTy, Loc);
3405 /*Pascal*/ false, ResTy, Loc);
3409 return PredefinedExpr::Create(Context, Loc, ResTy, IK, SL);
3476 ExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind) {
3490 return BuildPredefinedExpr(Loc, IK);
3550 ExprResult Sema::ActOnIntegerConstant(SourceLocation Loc, uint64_t Val) {
3553 Context.IntTy, Loc);
3557 QualType Ty, SourceLocation Loc) {
3579 S.Diag(Loc, diagnostic)
3585 return FloatingLiteral::Create(S.Context, Val, isExact, Ty, Loc);
3588 bool Sema::CheckLoopHintExpr(Expr *E, SourceLocation Loc) {
3961 SourceLocation Loc,
3968 S.Diag(Loc, diag::err_vecstep_non_scalar_vector_type)
3979 SourceLocation Loc,
3991 S.Diag(Loc, diag::ext_sizeof_alignof_function_type)
4001 S.Diag(Loc, DiagID) << getTraitSpelling(TraitKind) << ArgRange;
4009 SourceLocation Loc,
4015 S.Diag(Loc, diag::err_sizeof_nonfragile_interface)
4026 static void warnOnSizeofOnArrayDecay(Sema &S, SourceLocation Loc, QualType T,
4037 S.Diag(Loc, diag::warn_sizeof_array_decay) << ICE->getSourceRange()
4480 static QualType CheckRealImagOperand(Sema &S, ExprResult &V, SourceLocation Loc,
4505 return CheckRealImagOperand(S, V, Loc, IsReal);
4509 S.Diag(Loc, diag::err_realimag_invalid_type) << V.get()->getType()
7637 SourceLocation Loc) {
7682 S.Diag(Loc, diag::err_typecheck_op_on_nonoverlapping_address_space_pointers)
7732 S.Diag(Loc, diag::ext_typecheck_cond_incompatible_pointers)
7767 SourceLocation Loc) {
7778 S.Diag(Loc, diag::err_typecheck_cond_incompatible_operands)
7785 return checkConditionalPointerCompatibility(S, LHS, RHS, Loc);
7792 SourceLocation Loc) {
7824 return checkConditionalPointerCompatibility(S, LHS, RHS, Loc);
7830 Expr* PointerExpr, SourceLocation Loc,
7839 S.Diag(Loc, diag::ext_typecheck_cond_pointer_integer_mismatch)
8332 static void SuggestParentheses(Sema &Self, SourceLocation Loc,
8338 Self.Diag(Loc, Note)
8343 Self.Diag(Loc, Note) << ParenRange;
8869 Sema::CheckAssignmentConstraints(SourceLocation Loc,
8875 OpaqueValueExpr RHSExpr(Loc, RHSType, VK_RValue);
9463 QualType Sema::InvalidOperands(SourceLocation Loc, ExprResult &LHS,
9467 Diag(Loc, diag::err_typecheck_invalid_operands)
9490 QualType Sema::InvalidLogicalVectorOperands(SourceLocation Loc, ExprResult &LHS,
9501 Diag(Loc, diag::err_typecheck_logical_vector_expr_gnu_cpp_restrict)
9507 Diag(Loc, diag::err_typecheck_logical_vector_expr_gnu_cpp_restrict)
9763 SourceLocation Loc, bool IsCompAssign,
9789 return InvalidOperands(Loc, LHS, RHS);
9889 Diag(Loc, diag::err_typecheck_vector_not_convertable_non_scalar)
9902 Diag(Loc, diag::err_opencl_implicit_vector_conversion) << LHSType
9916 Diag(Loc,
9924 Diag(Loc, DiagID)
9934 SourceLocation Loc, bool IsCompare) {
9952 S.Diag(Loc, diag::warn_null_in_arithmetic_operation)
9964 S.Diag(Loc, diag::warn_null_in_comparison_operation)
9970 SourceLocation Loc) {
9992 S.Diag(Loc, diag::warn_division_sizeof_ptr) << LHS << LHS->getSourceRange();
10005 S.Diag(Loc, diag::warn_division_sizeof_array)
10013 S.Diag(Loc, diag::note_precedence_silence) << RHS;
10019 SourceLocation Loc, bool IsDiv) {
10025 S.DiagRuntimeBehavior(Loc, RHS.get(),
10031 SourceLocation Loc,
10033 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
10037 return CheckVectorOperands(LHS, RHS, Loc, IsCompAssign,
10042 return CheckMatrixMultiplyOperands(LHS, RHS, Loc, IsCompAssign);
10045 LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10051 return InvalidOperands(Loc, LHS, RHS);
10053 DiagnoseBadDivideOrRemainderValues(*this, LHS, RHS, Loc, IsDiv);
10054 DiagnoseDivisionSizeofPointerOrArray(*this, LHS.get(), RHS.get(), Loc);
10060 ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign) {
10061 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
10067 return CheckVectorOperands(LHS, RHS, Loc, IsCompAssign,
10070 return InvalidOperands(Loc, LHS, RHS);
10074 LHS, RHS, Loc, IsCompAssign ? ACK_CompAssign : ACK_Arithmetic);
10079 return InvalidOperands(Loc, LHS, RHS);
10080 DiagnoseBadDivideOrRemainderValues(*this, LHS, RHS, Loc, false /* IsDiv */);
10085 static void diagnoseArithmeticOnTwoVoidPointers(Sema &S, SourceLocation Loc,
10087 S.Diag(Loc, S.getLangOpts().CPlusPlus
10095 static void diagnoseArithmeticOnVoidPointer(Sema &S, SourceLocation Loc,
10097 S.Diag(Loc, S.getLangOpts().CPlusPlus
10108 static void diagnoseArithmeticOnNullPointer(Sema &S, SourceLocation Loc,
10111 S.Diag(Loc, diag::warn_gnu_null_ptr_arith)
10114 S.Diag(Loc, diag::warn_pointer_arith_null_ptr)
10119 static void diagnoseArithmeticOnTwoFunctionPointers(Sema &S, SourceLocation Loc,
10123 S.Diag(Loc, S.getLangOpts().CPlusPlus
10135 static void diagnoseArithmeticOnFunctionPointer(Sema &S, SourceLocation Loc,
10138 S.Diag(Loc, S.getLangOpts().CPlusPlus
10149 static bool checkArithmeticIncompletePointerType(Sema &S, SourceLocation Loc,
10158 Loc, PointeeTy,
10171 static bool checkArithmeticOpPointerOperand(Sema &S, SourceLocation Loc,
10181 diagnoseArithmeticOnVoidPointer(S, Loc, Operand);
10185 diagnoseArithmeticOnFunctionPointer(S, Loc, Operand);
10189 if (checkArithmeticIncompletePointerType(S, Loc, Operand)) return false;
10203 static bool checkArithmeticBinOpPointerOperands(Sema &S, SourceLocation Loc,
10216 S.Diag(Loc,
10228 if (!isRHSVoidPtr) diagnoseArithmeticOnVoidPointer(S, Loc, LHSExpr);
10229 else if (!isLHSVoidPtr) diagnoseArithmeticOnVoidPointer(S, Loc, RHSExpr);
10230 else diagnoseArithmeticOnTwoVoidPointers(S, Loc, LHSExpr, RHSExpr);
10238 if (!isRHSFuncPtr) diagnoseArithmeticOnFunctionPointer(S, Loc, LHSExpr);
10239 else if (!isLHSFuncPtr) diagnoseArithmeticOnFunctionPointer(S, Loc,
10241 else diagnoseArithmeticOnTwoFunctionPointers(S, Loc, LHSExpr, RHSExpr);
10246 if (isLHSPointer && checkArithmeticIncompletePointerType(S, Loc, LHSExpr))
10248 if (isRHSPointer && checkArithmeticIncompletePointerType(S, Loc, RHSExpr))
10337 static void diagnosePointerIncompatibility(Sema &S, SourceLocation Loc,
10341 S.Diag(Loc, diag::err_typecheck_sub_ptr_compatible)
10348 SourceLocation Loc, BinaryOperatorKind Opc,
10350 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
10355 LHS, RHS, Loc, CompLHSTy,
10364 return CheckMatrixElementwiseOperands(LHS, RHS, Loc, CompLHSTy);
10368 LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
10374 diagnoseStringPlusInt(*this, Loc, LHS.get(), RHS.get());
10375 diagnoseStringPlusChar(*this, Loc, LHS.get(), RHS.get());
10400 return InvalidOperands(Loc, LHS, RHS);
10406 return InvalidOperands(Loc, LHS, RHS);
10420 diagnoseArithmeticOnNullPointer(*this, Loc, PExp, IsGNUIdiom);
10424 if (!checkArithmeticOpPointerOperand(*this, Loc, PExp))
10427 if (isObjCPointer && checkArithmeticOnObjCPointer(*this, Loc, PExp))
10448 SourceLocation Loc,
10450 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
10455 LHS, RHS, Loc, CompLHSTy,
10464 return CheckMatrixElementwiseOperands(LHS, RHS, Loc, CompLHSTy);
10468 LHS, RHS, Loc, CompLHSTy ? ACK_CompAssign : ACK_Arithmetic);
10486 checkArithmeticOnObjCPointer(*this, Loc, LHS.get()))
10502 diagnoseArithmeticOnNullPointer(*this, Loc, LHS.get(), false);
10506 if (!checkArithmeticOpPointerOperand(*this, Loc, LHS.get()))
10525 diagnosePointerIncompatibility(*this, Loc, LHS.get(), RHS.get());
10532 diagnosePointerIncompatibility(*this, Loc, LHS.get(), RHS.get());
10537 if (!checkArithmeticBinOpPointerOperands(*this, Loc,
10549 Diag(Loc,diag::warn_sub_ptr_zero_size_types)
10560 return InvalidOperands(Loc, LHS, RHS);
10570 SourceLocation Loc, BinaryOperatorKind Opc,
10585 S.DiagRuntimeBehavior(Loc, RHS.get(),
10597 S.DiagRuntimeBehavior(Loc, RHS.get(),
10623 S.DiagRuntimeBehavior(Loc, LHS.get(),
10646 S.Diag(Loc, diag::warn_shift_result_sets_sign_bit)
10652 S.Diag(Loc, diag::warn_shift_result_gt_typewidth)
10661 SourceLocation Loc, bool IsCompAssign) {
10665 S.Diag(Loc, diag::err_shift_rhs_only_vector)
10692 S.Diag(Loc, diag::err_typecheck_expect_int)
10698 S.Diag(Loc, diag::err_typecheck_expect_int)
10720 S.Diag(Loc, diag::err_typecheck_vector_lengths_not_equal)
10730 S.Diag(Loc, diag::warn_typecheck_vector_element_sizes_not_equal)
10747 SourceLocation Loc, BinaryOperatorKind Opc,
10749 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
10760 return InvalidOperands(Loc, LHS, RHS);
10763 return InvalidOperands(Loc, LHS, RHS);
10765 return checkVectorShift(*this, LHS, RHS, Loc, IsCompAssign);
10789 return InvalidOperands(Loc, LHS, RHS);
10795 return InvalidOperands(Loc, LHS, RHS);
10798 DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType);
10805 static void diagnoseDistinctPointerComparison(Sema &S, SourceLocation Loc,
10808 S.Diag(Loc, IsError ? diag::err_typecheck_comparison_of_distinct_pointers
10816 static bool convertPointersToCompositeType(Sema &S, SourceLocation Loc,
10832 QualType T = S.FindCompositePointerType(Loc, LHS, RHS);
10836 diagnoseDistinctPointerComparison(S, Loc, LHS, RHS, /*isError*/true);
10838 S.InvalidOperands(Loc, LHS, RHS);
10845 static void diagnoseFunctionPointerToVoidComparison(Sema &S, SourceLocation Loc,
10849 S.Diag(Loc, IsError ? diag::err_typecheck_comparison_of_fptr_to_void
10956 static void diagnoseObjCLiteralComparison(Sema &S, SourceLocation Loc,
10985 S.Diag(Loc, diag::warn_objc_string_literal_comparison)
10988 S.Diag(Loc, diag::warn_objc_literal_comparison)
10996 CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
10998 S.Diag(Loc, diag::note_objc_literal_comparison_isequal)
11007 ExprResult &RHS, SourceLocation Loc,
11023 << Loc << IsBitwiseOp;
11062 static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc,
11104 S.Diag(Loc, diag::warn_depr_array_comparison)
11133 S.DiagRuntimeBehavior(Loc, nullptr,
11152 S.DiagRuntimeBehavior(Loc, nullptr,
11182 S.DiagRuntimeBehavior(Loc, nullptr,
11228 SourceLocation Loc) {
11272 SourceLocation Loc) {
11286 S.InvalidOperands(Loc, LHSStripped, RHSStripped);
11297 S.InvalidOperands(Loc, LHSStripped, RHSStripped);
11306 S.InvalidOperands(Loc, LHS, RHS);
11327 S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison);
11331 return S.InvalidOperands(Loc, LHS, RHS);
11336 return S.InvalidOperands(Loc, LHS, RHS);
11348 *CCT, Loc, Sema::ComparisonCategoryUsage::OperatorInExpression);
11353 SourceLocation Loc,
11356 return checkArithmeticOrEnumeralThreeWayCompare(S, LHS, RHS, Loc);
11360 S.UsualArithmeticConversions(LHS, RHS, Loc, Sema::ACK_Comparison);
11364 return S.InvalidOperands(Loc, LHS, RHS);
11368 return S.InvalidOperands(Loc, LHS, RHS);
11372 S.CheckFloatComparison(Loc, LHS.get(), RHS.get());
11406 SourceLocation Loc,
11437 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/true);
11446 return CheckVectorCompareOperands(LHS, RHS, Loc, Opc);
11448 diagnoseLogicalNotOnLHSofCheck(*this, LHS, RHS, Loc, Opc);
11449 diagnoseTautologicalComparison(*this, Loc, LHS.get(), RHS.get(), Opc);
11455 return checkArithmeticOrEnumeralCompare(*this, LHS, RHS, Loc, Opc);
11476 return InvalidOperands(Loc, LHS, RHS);
11482 Diag(Loc, diag::err_typecheck_three_way_comparison_of_pointer_and_zero)
11489 *CCT, Loc, ComparisonCategoryUsage::OperatorInExpression);
11518 *this, Loc, LHS, RHS, /*isError*/ (bool)isSFINAEContext());
11543 if (convertPointersToCompositeType(*this, Loc, LHS, RHS))
11564 Diag(Loc, diag::ext_typecheck_compare_complete_incomplete_pointers)
11571 Diag(Loc, diag::ext_typecheck_ordered_comparison_of_function_pointers)
11581 diagnoseFunctionPointerToVoidComparison(*this, Loc, LHS, RHS,
11585 diagnoseDistinctPointerComparison(*this, Loc, LHS, RHS, /*isError*/false);
11591 Diag(Loc,
11667 if (convertPointersToCompositeType(*this, Loc, LHS, RHS))
11682 Diag(Loc, diag::err_typecheck_comparison_of_distinct_blocks)
11699 Diag(Loc, diag::err_typecheck_comparison_of_distinct_blocks)
11724 diagnoseDistinctPointerComparison(*this, Loc, LHS, RHS,
11752 diagnoseDistinctPointerComparison(*this, Loc, LHS, RHS,
11755 diagnoseObjCLiteralComparison(*this, Loc, LHS, RHS, Opc);
11801 Diag(Loc, DiagID)
11849 return InvalidOperands(Loc, LHS, RHS);
11898 SourceLocation Loc,
11901 Diag(Loc, diag::err_three_way_vector_comparison);
11907 QualType vType = CheckVectorOperands(LHS, RHS, Loc, /*isCompAssign*/false,
11924 diagnoseTautologicalComparison(*this, Loc, LHS.get(), RHS.get(), Opc);
11930 CheckFloatComparison(Loc, LHS.get(), RHS.get());
11939 const SourceLocation Loc) {
11941 if (Loc.isMacroID())
11981 CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
12026 S.Diag(Loc, diag::warn_xor_used_as_pow_base)
12030 S.Diag(Loc, diag::warn_xor_used_as_pow) << ExprStr << XorValue.toString(10, true);
12034 S.Diag(Loc, diag::warn_xor_used_as_pow_base_extra)
12041 S.Diag(Loc, diag::note_xor_used_as_pow_silence) << ("0x2 ^ " + RHSStr) << SuggestXor;
12044 S.Diag(Loc, diag::warn_xor_used_as_pow_base)
12047 S.Diag(Loc, diag::note_xor_used_as_pow_silence) << ("0xA ^ " + RHSStr) << SuggestXor;
12052 SourceLocation Loc) {
12055 QualType vType = CheckVectorOperands(LHS, RHS, Loc, false,
12059 return InvalidOperands(Loc, LHS, RHS);
12062 return InvalidOperands(Loc, LHS, RHS);
12068 return InvalidLogicalVectorOperands(Loc, LHS, RHS);
12074 SourceLocation Loc,
12106 return InvalidOperands(Loc, OriginalLHS, OriginalRHS);
12113 return InvalidOperands(Loc, OriginalLHS, OriginalRHS);
12116 return InvalidOperands(Loc, LHS, RHS);
12120 SourceLocation Loc,
12137 return InvalidOperands(Loc, LHS, RHS);
12141 return InvalidOperands(Loc, LHS, RHS);
12147 return CheckMatrixElementwiseOperands(LHS, RHS, Loc, IsCompAssign);
12151 SourceLocation Loc,
12153 checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
12162 return CheckVectorOperands(LHS, RHS, Loc, IsCompAssign,
12165 return InvalidOperands(Loc, LHS, RHS);
12169 diagnoseLogicalNotOnLHSofCheck(*this, LHS, RHS, Loc, Opc);
12173 return InvalidOperands(Loc, LHS, RHS);
12177 LHSResult, RHSResult, Loc, IsCompAssign ? ACK_CompAssign : ACK_BitwiseOp);
12184 diagnoseXorMisusedAsPow(*this, LHS, RHS, Loc);
12188 return InvalidOperands(Loc, LHS, RHS);
12193 SourceLocation Loc,
12197 return CheckVectorLogicalOperands(LHS, RHS, Loc);
12209 Diag(Loc, diag::warn_enum_constant_in_bool_context);
12218 !Loc.isMacroID() && !inTemplateInstantiation()) {
12229 Diag(Loc, diag::warn_logical_instead_of_bitwise)
12233 Diag(Loc, diag::note_logical_instead_of_bitwise_change_operator)
12236 Loc, getLocForEndOfToken(Loc)),
12240 Diag(Loc, diag::note_logical_instead_of_bitwise_remove_constant)
12255 return InvalidOperands(Loc, LHS, RHS);
12268 return InvalidOperands(Loc, LHS, RHS);
12281 return InvalidOperands(Loc, LHS, RHS);
12286 return InvalidOperands(Loc, LHS, RHS);
12368 SourceLocation Loc) {
12397 S.Diag(Loc, diag::err_typecheck_assign_const)
12411 S.Diag(Loc, diag::err_typecheck_assign_const)
12441 S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange
12455 S.Diag(Loc, diag::err_typecheck_assign_const)
12468 S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange
12483 S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange << ConstUnknown;
12494 SourceLocation Loc, SourceRange Range,
12510 S.Diag(Loc, diag::err_typecheck_assign_const)
12534 SourceLocation Loc) {
12542 DiagnoseRecursiveConstFields(S, ME->getMemberDecl(), RTy, Loc,
12545 DiagnoseRecursiveConstFields(S, DRE->getDecl(), RTy, Loc,
12548 DiagnoseRecursiveConstFields(S, nullptr, RTy, Loc,
12551 DiagnoseConstAssignment(S, E, Loc);
12556 static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) {
12559 S.CheckShadowingDeclModification(E, Loc);
12561 SourceLocation OrigLoc = Loc;
12563 &Loc);
12614 if (Loc != OrigLoc)
12616 S.Diag(Loc, DiagID) << E->getSourceRange() << Assign;
12627 DiagnoseConstAssignment(S, E, Loc);
12633 DiagnoseConstAssignment(S, E, Loc);
12636 DiagnoseRecursiveConstFields(S, E, Loc);
12659 return S.RequireCompleteType(Loc, E->getType(),
12675 if (Loc != OrigLoc)
12678 S.Diag(Loc, DiagID) << E->getType() << E->getSourceRange() << Assign;
12680 S.Diag(Loc, DiagID) << E->getSourceRange() << Assign;
12685 SourceLocation Loc,
12691 if (Loc.isInvalid() || Loc.isMacroID())
12714 Sema.Diag(Loc, diag::warn_identity_field_assign) << 0;
12724 Sema.Diag(Loc, diag::warn_identity_field_assign) << 1;
12730 SourceLocation Loc,
12735 if (CheckForModifiableLvalue(LHSExpr, Loc, *this))
12746 Diag(Loc, diag::err_opencl_half_load_store) << 1
12755 CheckIdentityFieldAssignment(LHSExpr, RHSCheck, Loc, *this);
12771 Diag(Loc, diag::err_objc_object_assignment)
12781 Loc.isFileID() && UO->getOperatorLoc().isFileID() &&
12783 Loc.getLocWithOffset(1) == UO->getOperatorLoc() &&
12786 Loc.getLocWithOffset(2) != UO->getSubExpr()->getBeginLoc() &&
12788 Diag(Loc, diag::warn_not_compound_assign)
12821 checkUnsafeExprAssigns(Loc, LHSExpr, RHS.get());
12826 ConvTy = CheckAssignmentConstraints(Loc, LHSType, RHSType);
12829 if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType,
12846 Diag(Loc, diag::warn_deprecated_compound_assign_volatile) << LHSType;
12883 void Sema::DiagnoseCommaOperator(const Expr *LHS, SourceLocation Loc) {
12885 if (Loc.isMacroID())
12921 Diag(Loc, diag::warn_comma_operator);
12933 SourceLocation Loc) {
12956 S.RequireCompleteType(Loc, RHS.get()->getType(),
12960 if (!S.getDiagnostics().isIgnored(diag::warn_comma_operator, Loc))
12961 S.DiagnoseCommaOperator(LHS.get(), Loc);
13133 static void diagnoseAddressOfInvalidType(Sema &S, SourceLocation Loc,
13135 S.Diag(Loc, diag::err_typecheck_address_of) << Type << E->getSourceRange();
15241 SourceLocation Loc = Cap.getLocation();
15244 CXXScopeSpec(), DeclarationNameInfo(Var->getDeclName(), Loc), Var);
15260 Loc, Result.get());
15535 SourceLocation Loc,
15783 Diag(Loc, FDiag);
15809 void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
15810 S.Diag(Loc, diag::err_expr_not_ice) << S.LangOpts.CPlusPlus << SR;
15828 void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) override {
15829 S.Diag(Loc, DiagID) << SR;
15836 void Sema::VerifyICEDiagnoser::diagnoseFold(Sema &S, SourceLocation Loc,
15838 S.Diag(Loc, diag::ext_expr_not_ice) << SR << S.LangOpts.CPlusPlus;
15860 SemaDiagnosticBuilder diagnoseNotInt(Sema &S, SourceLocation Loc,
15862 return S.Diag(Loc, diag::err_ice_not_integral) << T;
15866 Sema &S, SourceLocation Loc, QualType T) override {
15867 return S.Diag(Loc, diag::err_ice_incomplete_type) << T;
15871 Sema &S, SourceLocation Loc, QualType T, QualType ConvTy) override {
15872 return S.Diag(Loc, diag::err_ice_explicit_conversion) << T << ConvTy;
15882 Sema &S, SourceLocation Loc, QualType T) override {
15883 return S.Diag(Loc, diag::err_ice_ambiguous_conversion) << T;
15893 Sema &S, SourceLocation Loc, QualType T, QualType ConvTy) override {
16450 SourceLocation Loc) {
16459 void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
16476 S.Diag(Loc, diag::err_cconv_incomplete_param_type)
16483 S.RequireCompleteType(Loc, Param->getType(), Diagnoser);
16541 void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
16614 checkSpecializationVisibility(Loc, Func);
16617 CheckCUDACall(Loc, Func);
16620 checkSYCLDeviceFunction(Loc, Func);
16624 runWithSufficientStackSpace(Loc, [&] {
16633 DefineImplicitDefaultConstructor(Loc, Constructor);
16635 DefineImplicitCopyConstructor(Loc, Constructor);
16637 DefineImplicitMoveConstructor(Loc, Constructor);
16640 DefineInheritingConstructor(Loc, Constructor);
16648 DefineImplicitDestructor(Loc, Destructor);
16651 MarkVTableUsed(Loc, Destructor->getParent());
16658 DefineImplicitCopyAssignment(Loc, MethodDecl);
16660 DefineImplicitMoveAssignment(Loc, MethodDecl);
16667 DefineImplicitLambdaToBlockPointerConversion(Loc, Conversion);
16669 DefineImplicitLambdaToFunctionPointerConversion(Loc, Conversion);
16671 MarkVTableUsed(Loc, MethodDecl->getParent());
16677 DefineDefaultedComparison(Loc, Func, DCK);
16688 PointOfInstantiation = Loc;
16694 PointOfInstantiation = Loc;
16721 MarkFunctionReferenced(Loc, i, MightBeOdrUse);
16738 ResolveExceptionSpec(Loc, FPT);
16745 UndefinedButUsed.insert(std::make_pair(Func->getCanonicalDecl(), Loc));
16749 UndefinedButUsed.insert(std::make_pair(Func->getCanonicalDecl(), Loc));
16751 UndefinedButUsed.insert(std::make_pair(Func->getCanonicalDecl(), Loc));
16758 CheckCompleteParameterTypesForMangler(*this, Func, Loc);
16770 CheckCompleteDestructorVariant(Loc, Dtor);
16786 MarkVarDeclODRUsed(VarDecl *Var, SourceLocation Loc, Sema &SemaRef,
16796 old = Loc;
16801 SemaRef.tryCaptureVariable(Var, Loc, Sema::TryCapture_Implicit,
16811 SourceLocation Loc,
16813 MarkVarDeclODRUsed(Capture, Loc, *this, &CapturingScopeIndex);
16891 SourceLocation Loc,
16897 diagnoseUncapturableValueReference(S, Loc, Var, DC);
16906 SourceLocation Loc,
16918 S.Diag(Loc, diag::err_lambda_capture_anonymous_var);
16927 S.Diag(Loc, diag::err_ref_vm_type);
16939 S.Diag(Loc, diag::err_ref_flexarray_type);
16941 S.Diag(Loc, diag::err_lambda_capture_flexarray_type)
16954 S.Diag(Loc, diag::err_capture_block_variable)
16965 S.Diag(Loc, diag::err_opencl_block_ref_block);
16974 SourceLocation Loc,
16987 S.Diag(Loc, diag::err_ref_array_type);
17000 S.Diag(Loc, diag::err_arc_autoreleasing_capture)
17019 S.Diag(Loc, diag::warn_block_capture_autoreleasing);
17039 BSI->addCapture(Var, HasBlocksAttr, ByRef, Nested, Loc, SourceLocation(),
17049 SourceLocation Loc,
17082 Loc, SourceLocation(), CaptureType, Invalid);
17090 SourceLocation Loc,
17142 S.Diag(Loc, diag::err_arc_autoreleasing_capture) << /*lambda*/ 1;
17155 Loc, CaptureType,
17159 else if (S.RequireNonAbstractType(Loc, CaptureType,
17182 Loc, EllipsisLoc, CaptureType, Invalid);
17421 bool Sema::tryCaptureVariable(VarDecl *Var, SourceLocation Loc,
17425 return tryCaptureVariable(Var, Loc, Kind, EllipsisLoc,
17430 bool Sema::NeedToCaptureVariable(VarDecl *Var, SourceLocation Loc) {
17433 return !tryCaptureVariable(Var, Loc, TryCapture_Implicit, SourceLocation(),
17438 QualType Sema::getCapturedDeclRefType(VarDecl *Var, SourceLocation Loc) {
17443 if (tryCaptureVariable(Var, Loc, TryCapture_Implicit, SourceLocation(),
17861 static void DoMarkVarDeclReferenced(Sema &SemaRef, SourceLocation Loc,
17900 SemaRef.checkSpecializationVisibility(Loc, Var);
17919 PointOfInstantiation = Loc;
17997 MarkVarDeclODRUsed(Var, Loc, SemaRef);
18036 void Sema::MarkVariableReferenced(SourceLocation Loc, VarDecl *Var) {
18037 DoMarkVarDeclReferenced(*this, Loc, Var, nullptr);
18040 static void MarkExprReferenced(Sema &SemaRef, SourceLocation Loc,
18046 DoMarkVarDeclReferenced(SemaRef, Loc, Var, E);
18050 SemaRef.MarkAnyDeclReferenced(Loc, D, MightBeOdrUse);
18071 SemaRef.MarkAnyDeclReferenced(Loc, DM, MightBeOdrUse);
18106 SourceLocation Loc =
18108 MarkExprReferenced(*this, Loc, E->getMemberDecl(), E, MightBeOdrUse);
18121 void Sema::MarkAnyDeclReferenced(SourceLocation Loc, Decl *D,
18125 MarkVariableReferenced(Loc, VD);
18130 MarkFunctionReferenced(Loc, FD, MightBeOdrUse);
18146 SourceLocation Loc;
18151 MarkReferencedDecls(Sema &S, SourceLocation Loc) : S(S), Loc(Loc) { }
18165 S.MarkAnyDeclReferenced(Loc, D, true);
18174 void Sema::MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T) {
18175 MarkReferencedDecls Marker(*this, Loc);
18190 void visitUsedDecl(SourceLocation Loc, Decl *D) {
18191 S.MarkFunctionReferenced(Loc, cast<FunctionDecl>(D));
18237 bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts,
18255 push_back(sema::PossiblyUnreachableDiag(PD, Loc, Stmts));
18273 Diag(Loc, PD);
18280 bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement,
18283 Loc, Statement ? llvm::makeArrayRef(Statement) : llvm::None, PD);
18286 bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc,
18307 void diagnose(Sema &S, SourceLocation Loc, QualType T) override {
18309 S.Diag(Loc, diag::err_call_incomplete_return)
18314 S.Diag(Loc, diag::err_call_function_incomplete_return)
18321 if (RequireCompleteType(Loc, ReturnType, Diagnoser))
18330 SourceLocation Loc;
18355 Loc = Op->getOperatorLoc();
18361 Loc = Op->getOperatorLoc();
18369 Diag(Loc, diagnostic) << E->getSourceRange();
18373 Diag(Loc, diag::note_condition_assign_silence)
18378 Diag(Loc, diag::note_condition_or_assign_to_comparison)
18379 << FixItHint::CreateReplacement(Loc, "!=");
18381 Diag(Loc, diag::note_condition_assign_to_comparison)
18382 << FixItHint::CreateReplacement(Loc, "==");
18402 SourceLocation Loc = opE->getOperatorLoc();
18404 Diag(Loc, diag::warn_equality_with_extra_parens) << E->getSourceRange();
18406 Diag(Loc, diag::note_equality_comparison_silence)
18409 Diag(Loc, diag::note_equality_comparison_to_assign)
18410 << FixItHint::CreateReplacement(Loc, "=");
18414 ExprResult Sema::CheckBooleanCondition(SourceLocation Loc, Expr *E,
18435 Diag(Loc, diag::err_typecheck_statement_requires_scalar)
18439 CheckBoolLikeConversion(E, Loc);
18445 Sema::ConditionResult Sema::ActOnCondition(Scope *S, SourceLocation Loc,
18454 Cond = CheckBooleanCondition(Loc, SubExpr);
18458 Cond = CheckBooleanCondition(Loc, SubExpr, true);
18462 Cond = CheckSwitchCondition(Loc, SubExpr);
18469 FullExprArg FullExpr = MakeFullExpr(Cond.get(), Loc);
18851 SourceLocation Loc = FD->getLocation();
18853 S.Context, FD->getDeclContext(), Loc, Loc,
18864 S.BuildParmVarDeclForTypedef(FD, Loc, AI);