6
votes

The following code compiles and run with Clang (tested on 13, 14, and current git head), but not with GCC.

struct foo {
  int field<0, 1, int, 3>;
};

But I do not understand what it is declaring: what is this field ?

int field<0, 1, int, 3>;

I can put whatever I want in the field<> template (if it is even a template?), e.g. field<0, 1, int, 3> compiles and run. But I cannot access it afterwards.

@463035818_is_not_a_number I said in my post that this is with clangJean-Michaël Celerier
yes I misread, though it also was very different code initially463035818_is_not_a_number
yeah I simplified it to the minimal thing that I foundJean-Michaël Celerier