public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vlad at petric dot cc" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66921] New: failure to determine size of static constexpr array that is nested within a templated class Date: Fri, 17 Jul 2015 21:54:00 -0000 [thread overview] Message-ID: <bug-66921-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66921 Bug ID: 66921 Summary: failure to determine size of static constexpr array that is nested within a templated class Product: gcc Version: 4.9.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vlad at petric dot cc Target Milestone: --- Created attachment 36010 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36010&action=edit straightforward file (include-less) that fails to compile template<typename T> struct Holder { constexpr static const int array[] = { 1, 2, 3 }; enum {F = array[0]}; }; class HI: public Holder<int> {}; gcc 4.9.3/Centos linux. $ g++ -std=c++11 ./x.cc -o x.o -c ./x.cc: In instantiation of ‘constexpr const int Holder<int>::array []’: ./x.cc:4:18: required from ‘struct Holder<int>’ ./x.cc:7:18: required from here ./x.cc:3:30: error: initializer fails to determine size of ‘Holder<int>::array’ constexpr static const int array[] = { 1, 2, 3 }; ^ ./x.cc:3:30: error: array must be initialized with a brace-enclosed initializer ./x.cc: In instantiation of ‘struct Holder<int>’: ./x.cc:7:18: required from here ./x.cc:4:8: error: enumerator value for ‘F’ is not an integer constant enum {F = array[0]}; * with gcc 4.8.3, it compiles just fine. * if I remove the template, it also compiles just fine: struct Holder { constexpr static const int array[] = { 1, 2, 3 }; enum {F = array[0]}; }; class HI: public Holder {}; >From gcc-bugs-return-492693-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 17 22:00:37 2015 Return-Path: <gcc-bugs-return-492693-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 16747 invoked by alias); 17 Jul 2015 22:00:37 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 16703 invoked by uid 48); 17 Jul 2015 22:00:33 -0000 From: "egall at gwmail dot gwu.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/28492] -Wmissing-format-attribute causes warning for vsnprintf() Date: Fri, 17 Jul 2015 22:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: minor X-Bugzilla-Who: egall at gwmail dot gwu.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: <bug-28492-4-MB61x4fnlL@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-28492-4@http.gcc.gnu.org/bugzilla/> References: <bug-28492-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01583.txt.bz2 Content-length: 1193 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28492 Eric Gallager <egall at gwmail dot gwu.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egall at gwmail dot gwu.edu --- Comment #4 from Eric Gallager <egall at gwmail dot gwu.edu> --- (In reply to Manuel López-Ibáñez from comment #3) > OK, I see that the warning is misleading, because it points to the call of > vsnprintf instead of pointing to vsnprintf_one. > > ttest.c: In function ‘vsnprintf_one’: > ttest.c:826:5: warning: function might be possible candidate for > ‘gnu_printf’ format attribute [-Wmissing-format-attribute] > vsnprintf(self, 2, "%c", arglist); > ^ Same thing with the other members of the vprintf family of functions, such as vfprintf... I remember getting particularly confused by this one in the past and hacking together some really ugly workarounds to deal with it, when all I really needed to do was to put the format attribute on the calling function, instead of trying to re-declare vfprintf... >From gcc-bugs-return-492694-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 17 22:24:11 2015 Return-Path: <gcc-bugs-return-492694-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 37454 invoked by alias); 17 Jul 2015 22:24:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 37335 invoked by uid 48); 17 Jul 2015 22:24:07 -0000 From: "mhw at netris dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/57271] ARM: gcc generates insufficient alignment for memory passed as extra argument for function return large composite type Date: Fri, 17 Jul 2015 22:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: mhw at netris dot org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: <bug-57271-4-cpNyCYtw3B@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-57271-4@http.gcc.gnu.org/bugzilla/> References: <bug-57271-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01584.txt.bz2 Content-length: 494 https://gcc.gnu.org/bugzilla/show_bug.cgi?idW271 Mark H Weaver <mhw at netris dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mhw at netris dot org --- Comment #10 from Mark H Weaver <mhw at netris dot org> --- I've encountered a similar problem, possibly related. See bug #66917 for a minimal C example program exhibiting the problem.
next reply other threads:[~2015-07-17 21:54 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-07-17 21:54 vlad at petric dot cc [this message] 2015-07-19 4:02 ` [Bug c++/66921] " anders.granlund.0 at gmail dot com 2015-07-20 16:59 ` billydonahue at google dot com 2015-08-04 14:11 ` [Bug c++/66921] [4.9/5/6 Regression] " paolo.carlini at oracle dot com 2015-10-16 8:24 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-66921-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).