[LLVMbugs] [Bug 14542] New: Bad diagnostic when omitting #include <vector> but having #include <iterator>

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 7 16:20:00 PST 2012


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

             Bug #: 14542
           Summary: Bad diagnostic when omitting #include <vector> but
                    having #include <iterator>
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I got this when building chromium with libc++:

../../chrome/browser/intents/cws_intents_registry.h:41:16: error: too few
template arguments for class template 'vector'
  typedef std::vector<IntentExtensionInfo> IntentExtensionList;
               ^
/Users/thakis/src/libcxx/include/iterator:1197:53: note: template is declared
here
    template <class _Tp, class _Alloc> friend class vector;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              ^
1 error generated.


The fix was just to add a "#include <vector>"


Maybe clang could detect that it's only seen a declaration of a template and
not a definition and say "note: try including the header with the definition of
class template 'vector'".

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list