[libcxx] r288564 - Fix -Wshadow warnings and enable warnings by default for C++ >= 11

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 17:21:41 PST 2016


Author: ericwf
Date: Fri Dec  2 19:21:40 2016
New Revision: 288564

URL: http://llvm.org/viewvc/llvm-project?rev=288564&view=rev
Log:
Fix -Wshadow warnings and enable warnings by default for C++ >= 11

Modified:
    libcxx/trunk/include/forward_list
    libcxx/trunk/test/libcxx/test/config.py

Modified: libcxx/trunk/include/forward_list
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/forward_list?rev=288564&r1=288563&r2=288564&view=diff
==============================================================================
--- libcxx/trunk/include/forward_list (original)
+++ libcxx/trunk/include/forward_list Fri Dec  2 19:21:40 2016
@@ -876,8 +876,9 @@ forward_list<_Tp, _Alloc>::forward_list(
 
 #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)
     {

Modified: libcxx/trunk/test/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=288564&r1=288563&r2=288564&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Fri Dec  2 19:21:40 2016
@@ -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',




More information about the cfe-commits mailing list