This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Don't crash on vector_size attribute in templates (PR c++/34913)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 22 Jan 2008 12:22:13 -0500
- Subject: Re: [C++ PATCH] Don't crash on vector_size attribute in templates (PR c++/34913)
- References: <20080122161556.GF2715@devserv.devel.redhat.com> <479621A3.1020008@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jan 22, 2008 at 12:02:27PM -0500, Jason Merrill wrote:
> In your comments on the PR, you mention that making vector_size a late
> attribute would lead to missing diagnostics. Do you have an example?
I meant something like:
template <int N> struct A
{
int i __attribute__((vector_size (16)));
int j[4] __attribute__((vector_size (16)));
int k[N] __attribute__((vector_size (16)));
void foo () { i + 1; } // { dg-error "invalid operand types" }
void bar () { j[0] + 1; } // { dg-error "invalid operand types" }
void baz () { k[0] + 1; }
};
alone, without instantiation. If vector_size is unconditionally
late attribute, there would be no errors, with the patch I posted there
are 2 (in foo and bar).
Jakub