[llvm-bugs] [Bug 26449] New: Bugs in __builtin_classify_type implementation

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 3 03:41:47 PST 2016


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

            Bug ID: 26449
           Summary: Bugs in __builtin_classify_type implementation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andreybokhanko at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

There are several bugs in __builtin_classify_type implementation:

1) It doesn't support member functions, so the following program crashes clang:

lass cl {
public:
    void bar() {}
};
...
int res = __builtin_classify_type(&cl::bar);

2) It returns enumeral_type_class for enums, function_type_class for functions
and array_type_class for arrays in both C and C++ modes. However, gcc returns
integer_type_class for enums and pointer_type_class for arrays and functions in
C mode -- which is correct, as conversions between enums and ints and function
pointers and arrays and pointers can happen everywhere in C. (gcc returns the
same as what clang does in C++ mode, however.)

2) It returns string_type_class for chars, which is odd and doesn't match what
gcc does.

Yours,
Andrey
======
Software Engineer
Intel Compiler Team

-- 
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/20160203/6e24d24d/attachment-0001.html>


More information about the llvm-bugs mailing list