From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16006 invoked by alias); 3 Oct 2014 19:53:29 -0000 Mailing-List: contact overseers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: overseers-owner@sourceware.org Received: (qmail 15996 invoked by uid 89); 3 Oct 2014 19:53:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 03 Oct 2014 19:53:27 +0000 Received: by mail-oi0-f41.google.com with SMTP id u20so1284370oif.28 for ; Fri, 03 Oct 2014 12:53:25 -0700 (PDT) X-Received: by 10.182.224.227 with SMTP id rf3mr6329812obc.70.1412366005270; Fri, 03 Oct 2014 12:53:25 -0700 (PDT) Received: from [192.168.254.26] ([74.196.225.29]) by mx.google.com with ESMTPSA id d6sm4904041obt.12.2014.10.03.12.53.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Oct 2014 12:53:24 -0700 (PDT) Message-ID: <542EFEB4.3000107@gmail.com> Date: Fri, 03 Oct 2014 19:53:00 -0000 From: Allen Webb User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: overseers@gcc.gnu.org Subject: gcc bugzilla account creation Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-q4/txt/msg00002.txt.bz2 overseers@gcc.gnu.org, I need to see about filing a bug for the gcc c++11 standard library, but I don't have a bugzilla account. the std::map::lower_bound() function doesn't work properly when the map only has one element. I have appended some test code that shows the problem. When the map has size()==1, the lower_bound function returns end() even though there is an element less than the key being compared. Allen //////////////////////////////////////////////////////////////////////////////// #include #include #include #define ts_t std::pair int main() { std::map test; uint32_t count = 0; test.insert(std::make_pair( std::make_pair(1403187740ull,698599ull), count++ )); ts_t key = std::make_pair(1403187740ull,698600ull); auto lower = test.lower_bound(key); auto upper = test.upper_bound(key); if(lower==test.end()) std::cout<<"no lower bound\n"; if(upper==test.end()) std::cout<<"no upper bound\n"; if(test.begin()->first < key) std::cout<<"key is less than begin()\n"; test.insert(std::make_pair( std::make_pair(1403187740ull,698601ull), count++ )); lower = test.lower_bound(key); upper = test.upper_bound(key); if(lower==test.end()) std::cout<<"no lower bound\n"; if(upper==test.end()) std::cout<<"no upper bound\n"; if(test.begin()->first < key) std::cout<<"key is less than begin()\n"; return EXIT_SUCCESS; }