This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Don't crash on vector_size attribute in templates (PR c++/34913)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]