public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/61458] New: std::aligned_storage is bigger than expected
Date: Mon, 09 Jun 2014 20:30:00 -0000	[thread overview]
Message-ID: <bug-61458-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61458

            Bug ID: 61458
           Summary: std::aligned_storage is bigger than expected
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

#include <type_traits>

static_assert(sizeof(std::aligned_storage<4>::type) == 4, "");


so.cc: In function ‘int main()’:
so.cc:5:3: error: static assertion failed: 
   static_assert(sizeof(std::aligned_storage<4>::type) == 4, "");
   ^


I think this is conforming, but it would be more useful if it passed.

We use the maximum alignment supported for any type, where we should use the
maximum alignment supported for types less than 4 bytes
>From gcc-bugs-return-453572-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 09 20:34:30 2014
Return-Path: <gcc-bugs-return-453572-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31481 invoked by alias); 9 Jun 2014 20:34:29 -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 31434 invoked by uid 55); 9 Jun 2014 20:34:25 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/36446] unexplained warning in struct initialization
Date: Mon, 09 Jun 2014 20:34: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.1
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-36446-4-0WvH80AQZX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-36446-4@http.gcc.gnu.org/bugzilla/>
References: <bug-36446-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: 2014-06/txt/msg00654.txt.bz2
Content-length: 1631

https://gcc.gnu.org/bugzilla/show_bug.cgi?id6446

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Mon Jun  9 20:33:51 2014
New Revision: 211388

URL: http://gcc.gnu.org/viewcvs?rev!1388&root=gcc&view=rev
Log:
    PR c/36446
    * c-typeck.c (error_init): Call inform instead of error_at.
    (pedwarn_init): Call inform instead of pedwarn.
    (warning_init): Call inform instead of warning_at.

    * gcc.dg/Wcxx-compat-6.c: Change dg-warning to dg-message.
    * gcc.dg/array-2.c: Likewise.
    * gcc.dg/array-const-2.c: Likewise.
    * gcc.dg/ucnid-8.c: Likewise.
    * gcc.dg/vla-init-1.c: Likewise.
    * gcc.dg/array-const-3.c: Change dg-error to dg-message.
    * gcc.dg/c99-flex-array-7.c: Likewise.
    * gcc.dg/init-bad-1.c: Likewise.
    * gcc.dg/init-bad-3.c: Likewise.
    * gcc.dg/init-bad-2.c: Change dg-error and dg-warning to dg-message.
    * gcc.dg/pedwarn-init.c: Add dg-warning.
    * gcc.dg/pr53119.c: Remove dg-excess-errors.

Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/Wcxx-compat-6.c
    trunk/gcc/testsuite/gcc.dg/array-2.c
    trunk/gcc/testsuite/gcc.dg/array-const-2.c
    trunk/gcc/testsuite/gcc.dg/array-const-3.c
    trunk/gcc/testsuite/gcc.dg/c99-flex-array-7.c
    trunk/gcc/testsuite/gcc.dg/init-bad-1.c
    trunk/gcc/testsuite/gcc.dg/init-bad-2.c
    trunk/gcc/testsuite/gcc.dg/init-bad-3.c
    trunk/gcc/testsuite/gcc.dg/pedwarn-init.c
    trunk/gcc/testsuite/gcc.dg/pr53119.c
    trunk/gcc/testsuite/gcc.dg/ucnid-8.c
    trunk/gcc/testsuite/gcc.dg/vla-init-1.c


             reply	other threads:[~2014-06-09 20:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 20:30 redi at gcc dot gnu.org [this message]
2014-09-19 13:29 ` [Bug libstdc++/61458] " redi at gcc dot gnu.org
2015-01-30 10:33 ` redi at gcc dot gnu.org
2015-01-30 12:17 ` redi at gcc dot gnu.org
2015-01-31 12:12 ` paolo.carlini at oracle dot com
2015-04-22 11:59 ` jakub at gcc dot gnu.org
2015-05-08 15:06 ` redi at gcc dot gnu.org
2015-07-16  9:18 ` 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-61458-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: link
Be 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).