http://llvm.org/bugs/show_bug.cgi?id=20008

            Bug ID: 20008
           Summary: clang-cl doesn't support the ui32 type suffix properly
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

The headers that ship with MSVC define UINT32_MAX as 0xffffffffui32.  I'm not
100% sure what "ui32" is but I assume it denotes a uint32_t type.  It seems
like this confuses clang-cl a bit, which makes it a pain in places where for
example we call std::min with a uint32_t argument and a UINT32_MAX-1 argument. 
Here is a minimal test case demonstrating the issue:

#include <stdint.h>
template<class T> T min(T, T);
#define MAX 0xffffffffui32
void test() {
  uint32_t a;
  min(a, MAX - 1);
}

$ ./bin/clang-cl -c test.cpp
test.cpp(6,3) :  error: no matching function for call to 'min'
  min(a, MAX - 1);
  ^~~
test.cpp(2,21) :  note: candidate template ignored: deduced conflicting types
for parameter 'T' ('unsigned int' vs. 'unsigned long')
template<class T> T min(T, T);
                    ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to