[Bug c++/15337] New: sizeof on incomplete type diagnostic

ghost at cs dot msu dot su gcc-bugzilla@gcc.gnu.org
Fri May 7 07:10:00 GMT 2004


When sizeof is applied to incomplete type, gcc 3.4 does not report the name of 
the class sizeof was applied to. For example: 
 
    class C; 
    int main() { sizeof(C); return 0; } 
 
produces: 
 
     sizeof.cpp:4: `sizeof' applied to incomplete type `C' 
 
with 3.2, but 
 
     sizeof.cpp:4: error: invalid application of `sizeof' to an incomplete 
      type 
 
with 3.4 
 
This change considerably impacts usability of the Boost.static_assert library: 
 
     http://www.boost.org/libs/static_assert/static_assert.htm 
 
since the library attempts to generate error message that is highly visible in 
the compiler output and applies sizeof to BOOST_STATIC_ASSERT_FAILURE class 
for that purpose. With current diagnostics, static assertion failure -- which 
is the first thing user should be looking at -- is hidden between other errors 
and instantination stack, which makes static asserts much less usefull.

-- 
           Summary: sizeof on incomplete type diagnostic
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ghost at cs dot msu dot su
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15337



More information about the Gcc-bugs mailing list