================ @@ -3591,15 +3591,20 @@ static void handleInitPriorityAttr(Sema &S, Decl *D, const ParsedAttr &AL) { return; } + if (prioritynum < 0 || prioritynum > 65535) { + S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_range) + << E->getSourceRange() << AL << 0 << 65535; + AL.setInvalid(); + return; + } + // Only perform the priority check if the attribute is outside of a system // header. Values <= 100 are reserved for the implementation, and libc++ // benefits from being able to specify values in that range. - if ((prioritynum < 101 || prioritynum > 65535) && + if (prioritynum < 101 && !S.getSourceManager().isInSystemHeader(AL.getLoc())) { - S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_range) ---------------- erichkeane wrote:
Since this is changing to a warning, the `isInSystemHeader` check no longer needs to happen (as we suppress system header warnings anyway). https://github.com/llvm/llvm-project/pull/121577 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits