[llvm-bugs] [Bug 47653] Working in MSVC but not in CLANG

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 27 12:29:24 PDT 2020


Aditya Nugraha <vortexilation at gmail.com> changed:

           What    |Removed                     |Added
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #4 from Aditya Nugraha <vortexilation at gmail.com> ---
Thanks hstong, i think we can close this report as i am also cannot reproduce
with the following simple case :
#include <stdio.h>

int add(int x, int y) { return x + y; }
int sub(int x, int y) { return x - y; }

int main() {
    int choice;

    printf("Enter 1 for add or 0 for sub: ");
    scanf("%d", &choice);

    // either add or sub will be called with args 1, 2, depending on truth
value of choice,
    // i.e., whether choice is non-zero (true) or zero (false).
    int result = (choice ? add : sub)(1, 2);

    printf("%d\n", result);

    return 0;

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200927/c1841b8a/attachment.html>

More information about the llvm-bugs mailing list