[LLVMbugs] [Bug 22838] New: Error about incomplete field is issued for typedef in incomplete class, but not for incomplete class itself

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 7 13:39:46 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22838

            Bug ID: 22838
           Summary: Error about incomplete field is issued for typedef in
                    incomplete class, but not for incomplete class itself
           Product: clang
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the attached example c1-set.cpp, the following error is issued for the
field 'set<X>::iterator ii', because 'set<X>::iterator' is undefined:
> error: field has incomplete type 'value_type' (aka 'X')
> note: definition of 'X' is not complete until the closing '}'

PROBLEM#1: When 'ii' field is removed, compile succeeds, even though field
'set<X> mm' is also undefined. This is an inconsistent behavior.

PROBLEM#2: Replace 'set' with 'vector', and compile succeeds, even though
template-wise example is exactly the same, just the type of template container
is different. (see an attached case c1-vector.cpp which succeeds). This is
another inconsistent behavior.

gcc issues no such error, and this is more practically sound behavior, though I
am not sure how does it sit with the current C++ standard.

revision 231319 (~ current trunk)

-- 
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/20150307/13e91d80/attachment.html>


More information about the llvm-bugs mailing list