[LLVMbugs] [Bug 12539] New: Literal operator templates are never searched

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 12 14:14:11 PDT 2012


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

             Bug #: 12539
           Summary: Literal operator templates are never searched
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at quasiparticle.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following code should compile and run by the standard (13.5.8p5), but clang
rejects it with "error: no matching literal operator for call to 'operator ""
_x' with arguments of types 'const char *' and 'unsigned long'". Adding those
parameters, in violation of the standard, causes clang to reject it because of
that same violation.


template<char... Args>
int operator"" _x()
{
  return 1;
}

int main()
{
  return "asdf"_x;
}

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