public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xinliangli at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55245] Compiler segfault when compiling the small test case
Date: Fri, 09 Nov 2012 06:06:00 -0000 [thread overview]
Message-ID: <bug-55245-4-StcXUphNlX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55245-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245
--- Comment #2 from davidxl <xinliangli at gmail dot com> 2012-11-09 06:05:43 UTC ---
(In reply to comment #1)
> The problem actually exists in main line compiler too.
This is another test case.
Segfaults without option, but builds ok with -DOK.
The problem seems to be that the main variant of the array type
Vector2<float>[2] does not have size, while the variant Vector2_f[2] has. The
variant's size later gets reset to 0 (from main variant).
David
template <typename VType> class Vector2 {
public:
Vector2();
VType x() const;
};
typedef Vector2<float> Vector2_f;
void GetR(const Vector2_f mosaic_position[3]);
template <class C> struct DefaultDeleter {
float GetColorTexCoord(Vector2_f &tex_coord) const {
return tex_coord.x();
}
};
class GetT { private: virtual void TestBody(); };
void GetT::TestBody() {
#ifdef OK
Vector2<float> mosaic_position[2][3] = { };
#else
Vector2_f mosaic_position[2][3] = { };
#endif
}
next prev parent reply other threads:[~2012-11-09 6:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 0:22 [Bug c++/55245] New: " xinliangli at gmail dot com
2012-11-09 0:43 ` [Bug c++/55245] " xinliangli at gmail dot com
2012-11-09 6:06 ` xinliangli at gmail dot com [this message]
2012-11-09 9:06 ` [Bug c++/55245] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
2012-11-21 0:53 ` [Bug c++/55245] [4.6/4.7/4.8 Regression] Compiler segfault when compiling a " dnovillo at gcc dot gnu.org
2012-11-21 16:17 ` xinliangli at gmail dot com
2012-11-26 9:49 ` jakub at gcc dot gnu.org
2012-11-26 18:36 ` dnovillo at gcc dot gnu.org
2012-12-06 16:11 ` rguenth at gcc dot gnu.org
2012-12-06 22:18 ` [Bug c++/55245] [4.6 " jason at gcc dot gnu.org
2012-12-07 4:55 ` jason at gcc dot gnu.org
2012-12-07 5:15 ` jason at gcc dot gnu.org
2013-01-02 19:04 ` jason at gcc dot gnu.org
2013-01-02 19:05 ` jason at gcc dot gnu.org
2013-01-02 19:05 ` jason 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-55245-4-StcXUphNlX@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).