When I compile a set of c++ source files using nested namespaces directly with clang++ -std=c++1z -Wall -Wextra
I get no warnings.
Trying to compile the same source files with CMake, I get the following output which seems perfectly happy:
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is Clang 6.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to:
But when I run make I get this, everywhere:
warning: nested namespace
definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
I've got the following line in the top-level CMakeLists.txt
:
set (CMAKE_CXX_FLAGS_INIT "-Wall -Wextra -g -std=c++1z")
Is this just a problem with Make / should I try suppressing this or am I doing something wrong with CMake?
CMake version: 3.15.3
clang version: 6.0.0-1ubuntu2
Target: x86_64-pc-linux-gnu