Fix -Wshadow warnings and enable warnings by default for C++ >= 11
authorEric Fiselier <eric@efcs.ca>
Sat, 3 Dec 2016 01:21:40 +0000 (01:21 +0000)
committerEric Fiselier <eric@efcs.ca>
Sat, 3 Dec 2016 01:21:40 +0000 (01:21 +0000)
llvm-svn: 288564

libcxx/include/forward_list
libcxx/test/libcxx/test/config.py

index f344d2e..a75d6e9 100644 (file)
@@ -876,8 +876,9 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
 
 #if _LIBCPP_STD_VER > 11
 template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __a)
-    : base ( __a )
+forward_list<_Tp, _Alloc>::forward_list(size_type __n,
+                                        const allocator_type& __base_alloc)
+    : base ( __base_alloc )
 {
     if (__n > 0)
     {
index 4a2c1d7..df99871 100644 (file)
@@ -634,7 +634,11 @@ class Configuration(object):
         self.cxx.compile_flags += ['-D_LIBCPP_DEBUG=%s' % debug_level]
 
     def configure_warnings(self):
-        enable_warnings = self.get_lit_bool('enable_warnings', False)
+        default_enable_warnings = len(
+            self.config.available_features.intersection(
+                ['c++11', 'c++14', 'c++1z'])) != 0
+        enable_warnings = self.get_lit_bool('enable_warnings',
+                                            default_enable_warnings)
         if enable_warnings:
             self.cxx.warning_flags += [
                 '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER',