Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2012 19:01:34 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233193 - head/contrib/libstdc++/include/bits
Message-ID:  <201203191901.q2JJ1YJV081874@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Mar 19 19:01:34 2012
New Revision: 233193
URL: http://svn.freebsd.org/changeset/base/233193

Log:
  Add explicit braces to avoid dangling else in stl_tree.h.  This silences
  the following warning produced by clang trunk:
  
    In file included from /usr/src/sbin/devd/devd.cc:91:
    In file included from /usr/obj/usr/src/tmp/usr/include/c++/4.2/map:64:
    /usr/obj/usr/src/tmp/usr/include/c++/4.2/bits/stl_tree.h:987:2: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
  	  else
  	  ^
  
  MFC after:	3 days

Modified:
  head/contrib/libstdc++/include/bits/stl_tree.h

Modified: head/contrib/libstdc++/include/bits/stl_tree.h
==============================================================================
--- head/contrib/libstdc++/include/bits/stl_tree.h	Mon Mar 19 18:54:01 2012	(r233192)
+++ head/contrib/libstdc++/include/bits/stl_tree.h	Mon Mar 19 19:01:34 2012	(r233193)
@@ -982,10 +982,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 	}
       iterator __j = iterator(__y);
       if (__comp)
-	if (__j == begin())
-	  return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
-	else
-	  --__j;
+	{
+	  if (__j == begin())
+	    return pair<iterator,bool>(_M_insert(__x, __y, __v), true);
+	  else
+	    --__j;
+	}
       if (_M_impl._M_key_compare(_S_key(__j._M_node), _KeyOfValue()(__v)))
 	return pair<iterator, bool>(_M_insert(__x, __y, __v), true);
       return pair<iterator, bool>(__j, false);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203191901.q2JJ1YJV081874>