Attribute nobuiltin for operator new (Znwm)


Clang emits attribute “nobuiltin” for operator new/delete (and other variants) even without “-fno-builtin”.

Is there any reason for that? This blocks potential “new/delete” transformations…


We mark new expressions with the "builtin" attribute; other uses of operator new are treated as nobuiltin because the global operator new can be replaced by the user. See and . (At least, that's how it's supposed to work... it's possible there are bugs on the LLVM side.)