From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11364 invoked by alias); 7 Oct 2014 09:16:26 -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 11354 invoked by uid 89); 7 Oct 2014 09:16:26 -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 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 07 Oct 2014 09:16:24 +0000 Received: by mail-wi0-f169.google.com with SMTP id cc10so9103654wib.2 for ; Tue, 07 Oct 2014 02:16:22 -0700 (PDT) X-Received: by 10.181.13.143 with SMTP id ey15mr2945788wid.4.1412673381978; Tue, 07 Oct 2014 02:16:21 -0700 (PDT) Received: from [192.168.5.5] (156-149.dsl.iskon.hr. [89.164.156.149]) by mx.google.com with ESMTPSA id wk5sm19982691wjb.12.2014.10.07.02.16.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 02:16:21 -0700 (PDT) Message-ID: <5433AF43.9070102@gmail.com> Date: Tue, 07 Oct 2014 09:16:00 -0000 From: Ivo Doko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jonathan Wakely CC: gcc-help Subject: Re: A possible bug References: <54337368.4070407@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00034.txt.bz2 On 2014-10-07 10:57, Jonathan Wakely wrote: > It's probably simply > https://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition Thanks for the reply. What you propose makes sense. At least, it definitely explains why the error appears only without compiler optimisation (that was driving me insane). However, the only functions which access those static constexpr variables are member functions of the very class in which those variables are defined (or actually, there is only one function, because only one overload of xorshift_engine::xorshiftgen (in file xorshift.h) will be enabled at compile-time, depending on the class templete parameters). As far as I can see, the problem should happen only if static const(expr) variables are accessed outside the class/struct body. Besides, this doesn't explain why the error happens for shift_2 and shift_3 but not for shift_1 (keep in mind - function xorshift_engine::xorshiftgen always accesses each of these three static constexpr variables, in order).