From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123524 invoked by alias); 21 Oct 2016 16:03:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 123487 invoked by uid 89); 21 Oct 2016 16:03:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yb0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=eaPTE18BZl9DUf+pdaBYRlzSJpczcB170x5b2JL4Bx4=; b=MkgDLwQSVhaRVerrVMCeJZQtfYNcTr+GYN+hoT9WptWQcq+3oaAmDmJwj3UAnVkhDK 1+ib/GG8+p4O6/LvW6e51SEjHxNWiBOZE6N7kCiMqA63qxWQ8PLSmabJtdt6y9MVUN+/ y9DpEWyRLFH4PbkeGLrtjiRS6r9+yn5vebgf1XHkRPgtjKkt27mm8nWZ+nEXZDr6cbJ5 u/+81OtqFqOPu3m1ea2+1lSS6RaMG7Fba5LXoCApFZwbnbXWzHMhATOTtL2gCADl6IIg RJ1BP/RkPB1fnzcFLekPBdO4okNiSg5Q4sla9hTqUhRoKxAKqXC//ogxwZ1glzJsTtVE J8ew== X-Gm-Message-State: ABUngveEj8YzMKFtNv1G8EUXYb5DbxdEhfhVMxqmfx7hRAtDNihiJ8Odh2x0HrpUcCXpo8df25OlF2JMOHp+Dw== X-Received: by 10.37.70.196 with SMTP id t187mr1845880yba.121.1477065801512; Fri, 21 Oct 2016 09:03:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jonathan Wakely Date: Fri, 21 Oct 2016 16:03:00 -0000 Message-ID: Subject: Re: glibc test tst-thread_local1.cc fails to compile with latest GCC To: "Ellcey, Steve" Cc: "libc-alpha@sourceware.org" , "gcc@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-10/txt/msg00356.txt.bz2 On 19 October 2016 at 18:45, Ellcey, Steve wrote: > I have built the latest glibc sources with a ToT GCC and am trying to run= the glibc testsuite now. I ran into a couple of > new warnings that I fixed (locally) and am now looking at nptl/tst-thread= _local1.cc which dies with: > > tst-thread_local1.cc:172:7: error: =E2=80=98thread=E2=80=99 is not a memb= er of =E2=80=98std=E2=80=99 > std::thread thr{[func] {func (nullptr);}}; > > Does anyone know what is going on here? If I compile a small test progra= m: > > #include > int main(int, char **){ > std::thread tt; > } > > With G++ 5.4 (using -std=3Dc++11) this test program compiles. but with To= T GCC, it dies with: > > g++ -std=3Dc++11 thread.cc -lpthread -o x > thread.cc: In function =E2=80=98int main(int, char**)=E2=80=99: > thread.cc:5:5: error: =E2=80=98thread=E2=80=99 is not a member of =E2=80= =98std=E2=80=99 > std::thread tt; > ^~~ > thread.cc:5:5: note: suggested alternative: =E2=80=98fread=E2=80=99 > std::thread tt; > ^~~ > fread > > > Is there some C++ standard change that I am not aware of or some other he= ader file I need to include? No, what probably happened is GCC didn't detect a usable Pthreads implementation and so doesn't define std::thread. The header uses this condition around the definition of std::thread: #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)