llvm/llvm-project

auto allowed with a type in C++

Open

#164,273 opened on Oct 20, 2025

View on GitHub
 (10 comments) (0 reactions) (1 assignee)C++ (10,782 forks)batch import
clang:frontenddiverges-from:edgdiverges-from:gccdiverges-from:msvcgood first issue

Repository metrics

Stars
 (26,378 stars)
PR merge metrics
 (Avg merge 1d 2h) (1,000 merged PRs in 30d)

Description

We currently allow something like this in C++: https://godbolt.org/z/7fabbGfe6

void f() {
  auto int x = 1;
}

It looks like this was allowed as an extension in C++ because it was valid C but I don't think it makes sense to support this anymore.

Contributor guide