[llvm-bugs] [Bug 30201] New: Interaction of _Generic and __attribute__((overloadable))

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 30 12:43:46 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30201

            Bug ID: 30201
           Summary: Interaction of _Generic and
                    __attribute__((overloadable))
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nemanja.i.ibm at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following code causes a crash from the front end:

int __attribute__((overloadable)) test (int);
double __attribute__((overloadable)) test (double);
char testc(char);

#define testm(X) \
  _Generic ((X), \
            char : testc, \
            default: test) (X)


int foo() {
  return testm(4);
}

It crashes when it hits an UNREACHABLE in Sema::FixOverloadedFunctionReference.

There is no crash if the argument to the call is a char value.

-- 
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/20160830/dcb5489d/attachment.html>


More information about the llvm-bugs mailing list