[llvm-bugs] [Bug 47520] clang reports an error: no member a class defination

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 14 17:01:55 PDT 2020


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Clang is correct; this code is ill-formed. In the context of
C1<T1>::C2::C3::f(), C1<T1> is considered to be part of "the current
instantiation", because it can't be specialized without eliminating that
declaration of C1<T1>::C2::C3::f() as a member. Therefore the standard
specifies that lookup of E is done from the template definition context, and
because C1 has no dependent base classes, it needs to succeed in that context.

Now, GCC's behavior here is also conforming -- an implementation is more or
less never required to diagnose invalid template definitions if the template is
nevrer instantiated -- but the behavior of Clang and other compilers that
diagnose this eagerly (such as EDG) is generally considered preferable.

-- 
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/20200915/3709f80b/attachment.html>


More information about the llvm-bugs mailing list