<div dir="ltr"><div dir="ltr">Hi Devs,<br><div><div>consider below testcase</div><div><br></div><div>$cat test.cpp</div><div><br></div><div>constexpr int product()</div><div>{</div><div><br></div><div>    return 10*20;</div><div>}</div><div>int main()</div><div>{</div><div>const   int x = product();</div><div>    return 0;</div><div>}</div><div><br></div><div><br></div><div>$./clang test.cpp -std=c++11 -S</div><div>$./clang -v</div><div>clang version 9.0.0</div><div>Target: x86_64-unknown-linux-gnu</div><div><br></div><div>$cat test.s</div><div><br></div><div>main:                                  </div><div>        .cfi_startproc</div><div># %bb.0:</div><div>        pushq   %rbp</div><div>        .cfi_def_cfa_offset 16</div><div>        .cfi_offset %rbp, -16</div><div>        movq    %rsp, %rbp</div><div>        .cfi_def_cfa_register %rbp</div><div>        subq    $16, %rsp</div><div>        movl    $0, -4(%rbp)</div><div>        callq   _Z7productv    //here you can see the calls to product function</div><div>        xorl    %ecx, %ecx</div><div>        movl    %eax, -8(%rbp)</div><div>        movl    %ecx, %eax</div><div>        addq    $16, %rsp</div><div>        popq    %rbp</div><div>        .cfi_def_cfa %rsp, 8</div><div>        retq</div><div><br></div><div><br></div><div>while g++ do not emits calls to constexpr function</div><div>$g++ test.cpp -std=c++11</div><div>$cat test.s</div><div>main:</div><div>.LFB1:</div><div>        .cfi_startproc</div><div>        pushq   %rbp</div><div>        .cfi_def_cfa_offset 16</div><div>        .cfi_offset 6, -16</div><div>        movq    %rsp, %rbp</div><div>        .cfi_def_cfa_register 6</div><div>        movl    $200, -4(%rbp)</div><div>        movl    $0, %eax</div><div>        popq    %rbp</div><div>        .cfi_def_cfa 7, 8</div><div>        ret</div><div>        .cfi_endproc</div><div><br></div><div>is this bug in clang compiler?</div></div></div></div>