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: unassignedclangb...@nondot.org
          Reporter: richard-l...@metafoo.co.uk
                CC: dgre...@apple.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to