Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ def CheriPedantic : DiagGroup<"cheri-pedantic", [CHERICapabilityToIntegerCast, C
// Warnings/Errors for bugs in the MIPS/CHERI backend
def MIPSCHERIBugs: DiagGroup<"mips-cheri-bugs">;

// Generally useful CHERI errors
def CHERIMissingCompartment: DiagGroup<"cheri-missing-compartment">;

def C99Compat : DiagGroup<"c99-compat">;
def C23Compat : DiagGroup<"c23-compat">;
def : DiagGroup<"c2x-compat", [C23Compat]>;
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def err_cheriot_invalid_sealed_declaration
: Error<"cannot declare a sealed variable as %0">;
def err_cheriot_invalid_sealing_key_type_name
: Error<"the sealing key type name '%0' is not a valid identifier">;
def err_cheriot_use_of_builtin_sealing_key_type_no_compartment
: Error<"%0 used, but no compartment name given">;
def warn_cheriot_use_of_builtin_sealing_key_type_no_compartment
: Warning<"%0 used, but no compartment name given">,InGroup<CHERIMissingCompartment>,DefaultError;

// C99 variable-length arrays
def ext_vla : Extension<"variable length arrays are a C99 feature">,
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaChecking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
}
if (getLangOpts().CheriCompartmentName.empty()) {
Diag(Arg->getExprLoc(),
diag::err_cheriot_use_of_builtin_sealing_key_type_no_compartment)
diag::warn_cheriot_use_of_builtin_sealing_key_type_no_compartment)
<< Context.BuiltinInfo.getName(
Builtin::BI__builtin_cheriot_sealing_type);
}
Expand Down