@fugueish@wandering.shop hmm yeah looks like clang hasn’t gotten the memo yet. i can get this to work with gcc, but the standard doesn’t allow type definitions in “underspecified” auto declarations, so i had to write
#define $Option(T) struct Option##T { T value; bool valid; }
#define $Some(T, v) ($Option(T)){ .value = v, .valid = true }
void printOption($Option(int) x) { ... }
int main() {
// can't use auto
$Option(int) o = $Some(int, 42);
printOption(o);
}