[LLVMbugs] [Bug 12777] New: Error recovery can trigger Assertion `DefinitionData && "queried property of class with no definition"' (DeclCXX.h:617)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 9 12:09:03 PDT 2012


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

             Bug #: 12777
           Summary: Error recovery can trigger Assertion `DefinitionData
                    && "queried property of class with no definition"'
                    (DeclCXX.h:617)
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hfinkel at anl.gov
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8520
  --> http://llvm.org/bugs/attachment.cgi?id=8520
reduced test case (provided by C.S.)

Running clang trunk on x86_64 on:

 template<class _CharT> struct char_traits;
     template<typename _CharT, typename _Traits = char_traits<_CharT> > class
basic_ios;
   class ios_base {
      iostate _M_exception;
    template<typename _CharT, typename _Traits> basic_ios<_CharT, _Traits>&
basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs) {
        _M_exception = goodbit;

results in:

In file included from prog.cpp:1:
prog.cpp:4:7: error: unknown type name 'iostate'
      iostate _M_exception;
      ^
prog.cpp:5:119: error: use of class template basic_ios requires template
arguments
    template<typename _CharT, typename _Traits> basic_ios<_CharT, _Traits>&
basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs) {
                                                                               
                                      ^
prog.cpp:2:79: note: template is declared here
     template<typename _CharT, typename _Traits = char_traits<_CharT> > class
basic_ios;
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       ^
prog.cpp:5:105: error: out-of-line definition of 'copyfmt' from class
'basic_ios<_CharT, _Traits>' without definition
    template<typename _CharT, typename _Traits> basic_ios<_CharT, _Traits>&
basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs) {
                                                                           
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
prog.cpp:6:32: error: expected '}'
        _M_exception = goodbit;
                               ^
prog.cpp:3:19: note: to match this '{'
   class ios_base {
                  ^
clang:
/src/llvm-trunk-writable/tools/clang/lib/AST/../../include/clang/AST/DeclCXX.h:617:
const clang::CXXRecordDecl::DefinitionData& clang::CXXRecordDecl::data() const:
Assertion `DefinitionData && "queried property of class with no definition"'
failed.

-- 
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