Fix warnings in test/std/language.support

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-07-18 21:17:16 +00:00
parent 692177d022
commit 7b86ce5cc4
10 changed files with 44 additions and 9 deletions

View File

@@ -150,3 +150,14 @@ class CXXCompiler(object):
cmd, out, err, rc = self.compile(os.devnull, out=os.devnull,
flags=flags)
return rc == 0
def addCompileFlagIfSupported(self, flag):
if isinstance(flag, list):
flags = list(flag)
else:
flags = [flag]
if self.hasCompileFlag(flags):
self.compile_flags += flags
return True
else:
return False

View File

@@ -570,10 +570,9 @@ class Configuration(object):
def configure_warnings(self):
enable_warnings = self.get_lit_bool('enable_warnings', False)
if enable_warnings:
self.cxx.compile_flags += ['-Wsystem-headers', '-Wall', '-Werror']
if ('clang' in self.config.available_features or
'apple-clang' in self.config.available_features):
self.cxx.compile_flags += ['-Wno-user-defined-literals']
self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',
'-Wall', '-Werror']
self.cxx.addCompileFlagIfSupported('-Wno-user-defined-literals')
def configure_sanitizer(self):
san = self.get_lit_conf('use_sanitizer', '').strip()