[clang] [clang] Reject 'auto' storage class with type specifier in C++ (PR #166004)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 3 06:54:21 PST 2025
================
@@ -42,7 +42,12 @@ void p3example() {
static auto y = 0.0;
----------------
AaronBallman wrote:
This line should also be diagnosed in C++98 mode... this seems to be a preexisting bug: https://godbolt.org/z/3cza618cx (we have a similar bug with `register`: https://godbolt.org/z/zs5918YY4)
GitHub is too useless to let me put this comment on the correct line, but line 40 has a similar C++98 bug: https://godbolt.org/z/xEozMhe6z because there's no type specifier there, and line 41 does as well for the same reason.
Hmmm, it seems we're treating type deduction as an extension in C++98 mode, but we don't list it in the language extensions page as such and we don't issue pedantic diagnostics for it. @zygoloid do you recall if this was an intentional extension or not? Regardless, because this is existing behavior, nothing needs to change as part of this PR.
https://github.com/llvm/llvm-project/pull/166004
More information about the cfe-commits
mailing list