[llvm-bugs] [Bug 31976] invalid application of 'sizeof' to an incomplete type 'B<typename std::decay<int>::type>' (aka 'B<int>')

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 15 15:53:38 PST 2017


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |richard-llvm at metafoo.co.uk
             Status|NEW                         |RESOLVED

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Instantiation of a class template specialization results in the instantiation
of the declarations, but not definitions, of members. However, for a static
data member defined within a class, the initializer *is* usually part of the
declaration (not the definition), and so it must be instantiated with the
class.

As a result, in the middle of instantiating A<int>::B<int>, your code attempts
to determine the size of that class, which is not possible because the class
has not been fully instantiated yet.

So this is a GCC bug.

-- 
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/20170215/98851b7e/attachment.html>


More information about the llvm-bugs mailing list