int main() { int x = "hello"; return 0; }
bool checkAge(int age) { if (age < 18) { std::cout << "Too young to vote." << std::endl; return false; } else { return true; } }This function checks the age of a person and returns true if they are old enough to vote. If the person is too young, it prints a message saying “Too young to vote”. To produce a diagnostic message for this message, we can use Sema Diag library. Package library for Sema Diag: LLVM (Low-Level Virtual Machine).