Open Endilll opened 1 year ago
@llvm/issue-subscribers-clang-frontend
@llvm/issue-subscribers-c-1
Confirmed: https://godbolt.org/z/sTqPqdeWr
Note gcc also does not catch this but MSVC does.
There is already a bunch of FIXME there https://github.com/llvm/llvm-project/blob/cfd44221e3e1783c0f44d5b1694dfbe84187246a/clang/lib/Sema/SemaLookup.cpp#L395-L407
This is CWG1, see https://clang.llvm.org/cxx_dr_status.html#1 and Clang's test cases for that DR, which include a few additional interesting cases that an implementation of this will need to handle.
[over.match.best]/4 includes an example with ill-formed code that Clang fails to diagnose:
For the reference, [dcl.fct.default]/4 states that "declarations that inhabit different scopes have completely distinct sets of default arguments." There's also a related CWG418 and a D139429 that adds a test for it.