https://bugs.llvm.org/show_bug.cgi?id=48384
Bug ID: 48384
Summary: [Concepts] void f(Constrained decltype(auto)) should
be rejected
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++2a
Assignee: unassignedclangb...@nondot.org
Reporter: arthur.j.odw...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
// https://godbolt.org/z/deh8oT
template<class> concept C = true;
void f(C decltype(auto));
Should be ill-formed, according to http://eel.is/c++draft/dcl.fct#18.sentence-6
, but Clang accepts it.
Clang does know that
void f(decltype(auto));
is ill-formed, but Clang doesn't know that
void f(C decltype(auto));
should also be ill-formed.
----
Incidentally, I'm confused about
template<decltype(auto)> void g();
template<C decltype(auto)> void h();
Clang, GCC, and MSVC all agree that both of those are well-formed, but I don't
know the rationale for accepting _template_ parameters of decltype(auto) type,
given that _function_ parameters of decltype(auto) type are forbidden.
GCC also accepts decltype(auto)& here:
template<decltype(auto)&> void i();
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs