[LLVMbugs] [Bug 12225] New: Doesn't allow a local declaration to declare a namespace-scope literal operator function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 10 05:15:40 PST 2012


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

             Bug #: 12225
           Summary: Doesn't allow a local declaration to declare a
                    namespace-scope literal operator function
           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


Clang rejects this:

int main() { 
  int operator "" _hello(unsigned long long x); 
  return 43_hello; 
}

"error: literal operator 'operator "" _hello' must be in a namespace or global
scope". 

I assume this is based on 13.5.8p2. The phrase "namespace-scope function" in
the spec refers to functions that are members of a namespace, as opposed to
functions that are class members (compare with uses of that phrase in 3.4.2 and
14.6.5p2). In those cases, it does not refer to the place of where declarations
of such a function appeared at (a function can have multiple declarations at
namespace scope, at class scope and also at block scope. Saying
"namespace-scope function" thus can not meaningfully apply to a declaration of
said function).

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