From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28856 invoked by alias); 19 May 2011 08:25:20 -0000 Received: (qmail 28840 invoked by uid 22791); 19 May 2011 08:25:17 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_QW,TW_SQ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 08:25:04 +0000 From: "bisqwit at iki dot fi" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49043] [OpenMP & C++0x]: Compiler error when lambda-function within OpenMP loop X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bisqwit at iki dot fi X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 19 May 2011 08:30:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01560.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49043 --- Comment #2 from Joel Yliluoma 2011-05-19 08:10:06 UTC --- Even if the lambda function is not called, it happens. Merely defining the function causes it. Interestingly though, it does not happen if a method body is defined within the loop. The code below does not cause the error. So it is restricted to lambda function bodies. It also does not happen when calling lambda functions that are defined outside the loop. int main() { #pragma omp parallel for for(int a=0; a<10; ++a) { struct tmp { static int test() { return 0; } }; } }