Bug 1483761 - Enable clang's -Wc++2a-compat warnings. r=glandium

Warn about C++ constructs whose meaning change in C++2a.

https://clang.llvm.org/docs/DiagnosticsReference.html#wc-2a-compat

So far the only -Wc++2a-compat check that I know of is for valid pre-C++2a code that inadvertently parses as C++2a's new <=> "spaceship" comparison operator. `f<&A::operator<=>();` is an example of a warning reported for a real project on GitHub. That code can be rewritten as `f< &operator<= >();`.

There are currently no -Wc++2a-compat warnings in mozilla-central.

Differential Revision: https://phabricator.services.mozilla.com/D3478

--HG--
extra : rebase_source : 4ec8147ad3fe2d1ef7c543d100c660a000385786
This commit is contained in:
Chris Peterson 2018-08-15 10:02:07 -07:00
Родитель d204b281a1
Коммит 863d823722
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -55,6 +55,7 @@ check_and_add_gcc_warning('-Wloop-analysis')
# catches C++ version forward-compat issues
check_and_add_gcc_warning('-Wc++1z-compat', cxx_compiler)
check_and_add_gcc_warning('-Wc++2a-compat', cxx_compiler)
# catches possible misuse of the comma operator
check_and_add_gcc_warning('-Wcomma', cxx_compiler)