public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51886] New: __alignof__ on uninstantiated template type
@ 2012-01-17 20:01 roland at gnu dot org
2012-01-17 20:03 ` [Bug c++/51886] " roland at gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: roland at gnu dot org @ 2012-01-17 20:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51886
Bug #: 51886
Summary: __alignof__ on uninstantiated template type
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: roland@gnu.org
The attached test case shows a bug when applying __alignof__ to a type that is
part of a template instantiation that has not otherwise been instantiated.
I noticed this on 4.4.3 but reproduced it on today's trunk (r183254).
This case needs to be compiled with -std=c++0x just because it uses
static_assert.
As the comment in the case indicates, simply doing an unrelated instantiation
of the template before the __alignof__ expression is evaluated makes the
problem disappear.
% gcc/g++ -Bgcc/ -S -o - -std=c++0x /tmp/template-align.cc
.file "template-align.cc"
/tmp/template-align.cc:9:1: error: static assertion failed: misaligned
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/51886] __alignof__ on uninstantiated template type
2012-01-17 20:01 [Bug c++/51886] New: __alignof__ on uninstantiated template type roland at gnu dot org
@ 2012-01-17 20:03 ` roland at gnu dot org
2012-01-17 20:39 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: roland at gnu dot org @ 2012-01-17 20:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51886
--- Comment #1 from roland at gnu dot org 2012-01-17 18:59:18 UTC ---
Created attachment 26357
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26357
C++ test case
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/51886] __alignof__ on uninstantiated template type
2012-01-17 20:01 [Bug c++/51886] New: __alignof__ on uninstantiated template type roland at gnu dot org
2012-01-17 20:03 ` [Bug c++/51886] " roland at gnu dot org
@ 2012-01-17 20:39 ` pinskia at gcc dot gnu.org
2021-08-11 21:06 ` pinskia at gcc dot gnu.org
2021-08-13 23:00 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-17 20:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51886
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-17 20:02:17 UTC ---
I think there might be a dup of this bug already in bugzilla.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/51886] __alignof__ on uninstantiated template type
2012-01-17 20:01 [Bug c++/51886] New: __alignof__ on uninstantiated template type roland at gnu dot org
2012-01-17 20:03 ` [Bug c++/51886] " roland at gnu dot org
2012-01-17 20:39 ` pinskia at gcc dot gnu.org
@ 2021-08-11 21:06 ` pinskia at gcc dot gnu.org
2021-08-13 23:00 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-11 21:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51886
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Depends on| |65734
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 5.3.0 and 6+ by the patch which fixed PR 65734.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65734
[Bug 65734] Yet another case of lost alignment by stor_layout
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/51886] __alignof__ on uninstantiated template type
2012-01-17 20:01 [Bug c++/51886] New: __alignof__ on uninstantiated template type roland at gnu dot org
` (2 preceding siblings ...)
2021-08-11 21:06 ` pinskia at gcc dot gnu.org
@ 2021-08-13 23:00 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-13 23:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51886
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |5.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-13 23:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-17 20:01 [Bug c++/51886] New: __alignof__ on uninstantiated template type roland at gnu dot org
2012-01-17 20:03 ` [Bug c++/51886] " roland at gnu dot org
2012-01-17 20:39 ` pinskia at gcc dot gnu.org
2021-08-11 21:06 ` pinskia at gcc dot gnu.org
2021-08-13 23:00 ` pinskia at gcc dot gnu.org
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).