[LLVMbugs] [Bug 12344] New: Confusing diagnostic for invalid tokens

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 24 08:01:45 PDT 2012


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

             Bug #: 12344
           Summary: Confusing diagnostic for invalid tokens
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: schaub.johannes at googlemail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The user wanted to call "invert" on the result of "600_bits". They didn't know
that the pp-number "600_bits.invert" does not convert to any valid token, so
they did write:

  struct Bits { Bits invert(); }; 
  Bits operator "" _bits(unsigned long long) { return{}; } 
  int main() { 600_bits.invert(); }

But clang could be more helpful:

error: no matching literal operator for call to 'operator "" _bits.invert' with
argument of type 'unsigned long long' or 'const char *', and no matching
literal operator template.

-- 
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.



More information about the llvm-bugs mailing list