From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16704 invoked by alias); 21 Jul 2014 08:51:36 -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 16121 invoked by uid 89); 21 Jul 2014 08:51:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: postina.bo.infn.it Received: from postina.bo.infn.it (HELO postina.bo.infn.it) (131.154.11.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 21 Jul 2014 08:51:18 +0000 Received: from pamina.bo.infn.it (pamina.bo.infn.it [131.154.10.143]) (authenticated bits=0) by postina.bo.infn.it (8.14.5/8.14.5) with ESMTP id s6L8pDMP025394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 21 Jul 2014 10:51:13 +0200 Message-ID: <53CCD481.60201@bo.infn.it> Date: Mon, 21 Jul 2014 08:51:00 -0000 From: Graziano Servizi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: question Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00079.txt.bz2 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... Thanks for your attention. G. Servizi