Oof that's not a good look. You can trivially avoid this by just prefixing all variable names with a salt. By the way this (or a variant thereof) is called "avoiding unwanted name capture" if you want to sound all sophisticated :)
Protobuf has similar problem: whatever names you use for your proto messages should be translated to the target language as is, and with multiple target languages, chances are that you'll hit a keyword in one of them; each language plugin should figure out how to resolve this.
$ cat test.proto
syntax = "proto3";
package test;
message TestMessage {
int32 register = 1;
int32 foo = 2;
}
$ protoc --cpp_out=. test.proto
$ grep 'register\|foo' test.pb.cc | head -n 2
: register__{0},
foo_{0},
(I may understand `register__`, but why `foo_`? no idea)