gbMattN wrote:
The ubsan handler for misaligned pointers contains data saying what type of
check caught the misalignment. One type of check is on the constructor call,
which is the check type which catches this issue with operator new.
In theory, could we check for this and print out a note with extra information
after the main diagnostic? Something like
```
//constructor call
if(Data->TypeCheckKind == 5){
Printf(
"\tNote: The default alignment of your architecture is %lu. Possible
invalid alignment from an overloaded operator new?\n",
__STDCPP_DEFAULT_NEW_ALIGNMENT__
);
}
```
Thoughts?
https://github.com/llvm/llvm-project/pull/152532
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits