https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103537
--- Comment #2 from Hedayat Vatankhah <hedayat.fwd at gmail dot com> --- With these options, the code runs a bit more but still crashes. The output of each option is given below: Output with -fsanitize=undefined: /home/hedayat/Projects/powerfake/powerfake.h:257:40: runtime error: load of misaligned address 0x00000044c556 for type '<unknown> *', which requires 8 byte alignment 0x00000044c556: note: pointer points here 00 e8 ac 5a 00 00 84 c0 74 17 48 8d 55 f4 48 8d 45 f8 48 89 c6 bf 00 5c 4b 00 e8 17 5b 00 00 eb ^ zsh: segmentation fault (core dumped) ./sample/samples Output with -fsanitize=address: AddressSanitizer:DEADLYSIGNAL ================================================================= ==261345==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x000000412704 bp 0x7ffcdfbd4c10 sp 0x7ffcdfbd4c00 T0) ==261345==The signal is caused by a READ memory access. ==261345==Hint: this fault was caused by a dereference of a high value address (see register values below). Dissassemble the provided pc to learn which register was used. #0 0x412704 in decltype(auto) PowerFake::internal::TagBase<OverloadedPrivateInt>::Call<FakeTest::SampleClass2, int>(FakeTest::SampleClass2&, int) (/home/hedayat/Projects/powerfake/build.o/sample/samples+0x412704) #1 0x404c14 in FakeOverloaded() (/home/hedayat/Projects/powerfake/build.o/sample/samples+0x404c14) #2 0x40364e in main (/home/hedayat/Projects/powerfake/build.o/sample/samples+0x40364e) #3 0x7ff8f02a055f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #4 0x7ff8f02a060b in __libc_start_main_alias_1 (/lib64/libc.so.6+0x2d60b) #5 0x403584 in _start (/home/hedayat/Projects/powerfake/build.o/sample/samples+0x403584) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/home/hedayat/Projects/powerfake/build.o/sample/samples+0x412704) in decltype(auto) PowerFake::internal::TagBase<OverloadedPrivateInt>::Call<FakeTest::SampleClass2, int>(FakeTest::SampleClass2&, int) ==261345==ABORTING