Because by the time the optimiser has resolved everything, it's all gone in a puff of logic.
$ g++ -std=c++14 foo.cpp
$ ./a.out
15
$ nm -C a.out
0000000000004010 B __bss_start
0000000000004150 b completed.8060
U __cxa_atexit@@GLIBC_2.2.5
w __cxa_finalize@@GLIBC_2.2.5
0000000000004000 D __data_start
0000000000004000 W data_start
00000000000010f0 t deregister_tm_clones
0000000000001160 t __do_global_dtors_aux
0000000000003d90 d __do_global_dtors_aux_fini_array_entry
0000000000004008 D __dso_handle
0000000000003d98 d _DYNAMIC
0000000000004010 D _edata
0000000000004158 B _end
00000000000012c8 T _fini
00000000000011a0 t frame_dummy
0000000000003d80 d __frame_dummy_init_array_entry
00000000000021a4 r __FRAME_END__
0000000000003f98 d _GLOBAL_OFFSET_TABLE_
0000000000001231 t _GLOBAL__sub_I_main
w __gmon_start__
0000000000002008 r __GNU_EH_FRAME_HDR
0000000000001000 t _init
0000000000003d90 d __init_array_end
0000000000003d80 d __init_array_start
0000000000002000 R _IO_stdin_used
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
00000000000012c0 T __libc_csu_fini
0000000000001250 T __libc_csu_init
U __libc_start_main@@GLIBC_2.2.5
00000000000011a9 T main
0000000000001120 t register_tm_clones
00000000000010c0 T _start
0000000000004010 D __TMC_END__
00000000000011e4 t __static_initialization_and_destruction_0(int, int)
U std::ostream::operator<<(unsigned long)@@GLIBCXX_3.4
U std::ios_base::Init::Init()@@GLIBCXX_3.4
U std::ios_base::Init::~Init()@@GLIBCXX_3.4
0000000000004040 B std::cout@@GLIBCXX_3.4
0000000000002004 r std::piecewise_construct
0000000000004151 b std::__ioinit
U std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)@@GLIBCXX_3.4
C++ Insights (after fixing the compile time errors) can show template instantiations: https://cppinsights.io/s/0bb08e15 (Ctrl+Enter to run C++ Insights)