https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65750
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed| |2015-04-13 Known to work| |4.8.3 Summary|miss interpret in a virtual |[4.9/5 Regression] |member function with a |misinterpret in a virtual |C++11 style function |member function with a |signature |C++11 style function | |signature Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Rejects-valid, introduced by support for C++14 return type deduction. Reduced: template<typename T> struct F { }; class a { virtual auto f( F< void () > ) -> void; virtual auto g( F< auto () -> void > ) -> void; }; auto main() -> int { } The error in comment 0 is only on the 4.9 branch, 5.0 gives a different error: s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 s.cc:6:38: error: template argument 1 is invalid virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 s.cc:6:38: error: template argument 1 is invalid virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 s.cc:6:38: error: template argument 1 is invalid virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 s.cc:6:38: error: template argument 1 is invalid virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:22: error: use of ‘auto’ in parameter declaration only available with -std=c++14 or -std=gnu++14 s.cc:6:38: error: template argument 1 is invalid virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:19: error: ‘F’ is not a type virtual auto g( F< auto () -> void > ) -> void; ^ s.cc:6:20: error: expected ‘,’ or ‘...’ before ‘<’ token virtual auto g( F< auto () -> void > ) -> void; ^