Commit 69c8c966 authored by Shoaib Meenai's avatar Shoaib Meenai Committed by Tobias Hieta
Browse files

[Sema] Use underlying type of scoped enum for -Wformat diagnostics (#67378)

Right now, `-Wformat` for a scoped enum will suggest a cast based on the
format specifier being used. This can lead to incorrect results, e.g.
attempting to format a scoped enum with `%s` would suggest casting to
`char *` instead of fixing the specifier. Change the logic to treat the
scoped enum's underlying type as the intended type to be printed, and
suggest format specifier changes and casts based on that.

(cherry picked from commit 0b07b06e)
parent b2417f51
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment