[LLVMbugs] [Bug 18855] New: Lexer produces incorrect identifier in user defined literals using UCNs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Feb 15 17:17:32 PST 2014


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

            Bug ID: 18855
           Summary: Lexer produces incorrect identifier in user defined
                    literals using UCNs
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: unassignedclangbugs at nondot.org
          Reporter: seth.cantrell at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This program:

> unsigned long long
> operator"" _µs(unsigned long long usec) {
>   return usec;
> }

int main() { 3_µs; }

produces the error:

> error: no matching literal operator for call to 'operator "" _' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
int main() { 3_µs; }

The error message indicates that the lexer is not correctly tokenizing the user
defined literal, and is truncating the identifier portion of the literal where
the UCN occurs. The same result occurs with the equivalent literal '3_\u00B5s'.

The result of the above program should be that the program calls the function
operator"" _µs with the argument 3ull.

-- 
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/20140216/de02a95e/attachment.html>


More information about the llvm-bugs mailing list