https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121368
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Yan from comment #0) > g++ -std=c++17 -Wall -Wextra -Wunused -O0 You are not using g++, you are using clang pretending to be g++ because that's how it's installed on macOS.