https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81486
Ted Lyngmo <ted at lyncon dot se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ted at lyncon dot se --- Comment #3 from Ted Lyngmo <ted at lyncon dot se> --- A comparison between g++ 8.2 and clang++ 6.0.1 g++ -fsanitize=undefined -std=c++17 -Wall -Wextra -Wshadow -Weffc++ -pedantic -pedantic-errors -Wc++14-compat -Wc++17-compat -c test.cpp clang++ -fsanitize=undefined -std=c++17 -Wall -Wextra -Wshadow -Weffc++ -pedantic -pedantic-errors -Wc++14-compat -Wc++17-compat -c test.cpp #include <functional> std::less lt_g; std::greater gt_g; // ok in g++ 8.2 // clang++ 6.0.1: // error: declaration of variable 'lt' with deduced type 'std::less' requires an initializer // error: declaration of variable 'gt' with deduced type 'std::greater' requires an initializer auto lt_c = std::less(); auto gt_c = std::greater(); // ok in clang++ 6.0.1 // g++ 8.2: // error: cannot deduce template arguments for ‘less’ from () // error: cannot deduce template arguments for ‘greater’ from () auto lt_b = std::less{}; auto gt_b = std::greater{}; // ok in both