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

             Bug #: 12717
           Summary: Incorrect lexing of pp-numbers in C++11 due to
                    hexfloat extension
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Clang support C99 hexadecimal literals as an extension in its C++ modes. This
is *almost* a conforming extension in C++98 mode, but it's far from being one
in C++11 mode. For instance, in C++98:

#define PREFIX(x) foo ## x
void f() {
  int PREFIX(1p);
  int PREFIX(2p) = PREFIX(1p+5); // incorrect error: foo1p+5 is not a pp-token
}

In the rules of C++, "1p+5" is three tokens, not one.

In C++11, this goes wrong in much less contrived situations:

Units<Amp> operator"" _amp(unsigned long long d);
int k = 4_amp+1; // incorrect error: no literal operator "" _amp+1

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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