[llvm-bugs] [Bug 38883] New: instantiating a friend member specialization declaration does not look up member specialization properly

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 9 23:29:11 PDT 2018


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

            Bug ID: 38883
           Summary: instantiating a friend member specialization
                    declaration does not look up member specialization
                    properly
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Clang rejects this valid code with an access violation error:

struct A { template<typename T> static int g0(T x) { return x.n; } };
template<typename T> class B { friend int A::g0<>(B<T>); int n; };
int k = A().g0(B<int>());

The problem is that in the instantiation B<int>, the friend declaration points
nowhere (and does not identify the A::g0<B<int>> specialization that it
should). Despite the friend declaration not being matched to any function, no
diagnostic is issued, and the result is the friend declaration is silently
ignored.

-- 
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/20180910/950d7b86/attachment-0001.html>


More information about the llvm-bugs mailing list