[llvm-bugs] [Bug 27807] New: name lookup on conversion function doesn't include object scope

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 18 15:41:33 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27807

            Bug ID: 27807
           Summary: name lookup on conversion function doesn't include
                    object scope
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang fails to compile this example
(http://stackoverflow.com/q/37310866/2069064):

struct S {
    using T = int;
    operator T() { return 42; }
};

int main() {
    S{}.operator T();
}

with:

prog.cc:7:18: error: unknown type name 'T'; did you mean 'S::T'?
    S{}.operator T();
                 ^
                 S::T
prog.cc:2:11: note: 'S::T' declared here
    using T = int;
          ^

But according to [basic.lookup.classref]/7 (updated from CWG 1111), the scope
of S should be considered. gcc compiles the example.

-- 
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/20160518/cba1d127/attachment.html>


More information about the llvm-bugs mailing list