From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20495 invoked by alias); 21 Jul 2014 09:10:00 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 20382 invoked by uid 89); 21 Jul 2014 09:09:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f179.google.com Received: from mail-lb0-f179.google.com (HELO mail-lb0-f179.google.com) (209.85.217.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 21 Jul 2014 09:09:52 +0000 Received: by mail-lb0-f179.google.com with SMTP id v6so4484915lbi.38 for ; Mon, 21 Jul 2014 02:09:49 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.93.75 with SMTP id cs11mr8656094lbb.82.1405933789407; Mon, 21 Jul 2014 02:09:49 -0700 (PDT) Received: by 10.112.188.164 with HTTP; Mon, 21 Jul 2014 02:09:49 -0700 (PDT) In-Reply-To: <53CCD481.60201@bo.infn.it> References: <53CCD481.60201@bo.infn.it> Date: Mon, 21 Jul 2014 09:10:00 -0000 Message-ID: Subject: Re: question From: Jonathan Wakely To: Graziano Servizi Cc: gcc-help Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00080.txt.bz2 On 21 July 2014 09:51, Graziano Servizi wrote: > Is there an "undefined behaviour" in the following short code? > > > // > # include > # include > > int main( ) > { > int c = 90; > double r = 70; > auto v = [c] (double c) > {std::cout << "homonymous dummy argument ... " << c << std::endl;}; > v(r); > } > > > // > > I ask this because the gnu-gcc compiler prints out the value of the > "captured" int c = 90 variable, while clang prints the value of the double r > = 70 transmitted argument instead... It looks like a GCC bug, please report it to Bugzilla.