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: vector comparisons in C++


On Fri, 14 Sep 2012, Jason Merrill wrote:

On 09/14/2012 09:59 AM, Marc Glisse wrote:
* build_vector_type: don't use an opaque vector for the return type of
   operator< (not sure what the point was of making it opaque?)

I think the point was to allow conversion of the result to a different vector type.

Ah, I see. I'll change it back to opaque and remove that use from the testcase. I noticed that for the fold patch, I am using once opaque and once not-opaque, I'll make them both opaque, although it probably doesn't matter once we are out of the front-end.


Why do you want it not to be opaque?

I wanted to use decltype(x<x) to find an integer vector type of the same size as x, and then actually be able to use it. Being opaque, it refuses to be initialized (cp/decl.c:5550). Maybe decltype (and others?) could return non-opaque types?


+	      error_at (location, "comparing vectors with different "
+				  "element types");

Let's print the vector types in these errors.

Type is %qT right? I see a number of %q#T but can't remember where the doc is. Well, I'll try both and see what happens.


Thanks,

--
Marc Glisse


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