https://llvm.org/bugs/show_bug.cgi?id=26685
Bug ID: 26685 Summary: Possibility for function with cv-qualifier-seq be adjusted to function pointer Product: clang Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: droff...@yandex.ru CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified Hello! Simple code: template <typename T> struct test { typedef void(* type)(T); }; typedef void foo_t() const; typedef test<foo_t>::type func_t; We've got a function type with cv-qualifier-seq acquires the properties of a function pointer, although it's prohibited by Standard. This behavior occurs in the entire range of compilers. Do I understand right that func_t (in this case) is invalid type, and it shouldn't be compiled? So we can use it to bypass the restrictions and create a pointer to cv-qualified function: template <typename F> struct create_pointer { typedef void func_t(F); template <typename X> struct extract { typedef X type; }; template <typename X> struct extract<void(X)> { typedef X type; }; typedef typename extract<func_t>::type type; }; int main() { create_pointer<void() const>::type p = 0; } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs