AaronBallman wrote: > > > ```c++ > > > typeof(int){} x; // Probably parsed as typeof(int{}) > > > ``` > > > > > > Actually, I’m not sure what we think this is supposed to be; I haven’t > > checked. > > Actually, that’s just a compound literal; I forgot we supported those in C++.
It's a reallllly funky compound literal though, so worth explaining for others: That's `(int){}` as a compound literal expression, which is the expression operand to an unparenthesized `typeof` operator, which yields the type `int` for the declaration of `x`. https://github.com/llvm/llvm-project/pull/146394 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits