Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9098

ASSERT in Cplusplus parser when parsing template code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • Qt Creator 2.8.0-beta
    • Qt Creator 2.7.0
    • C/C++/Obj-C++ Support
    • None
    • MSVC 2010 32 bit, debug build of 2.7.0
    • 17cd161a9d265db12ba763e090111f0fb27fbab9

    Description

      Self-compiled creator 2.7 (both 2.7.0 and latest 2.7) asserts for me when opening a project with Qt 4.8.4.

      Stack trace:

      0	CrtDbgReportW	MSVCR100D		0x613245f0	
      1	get_pgmptr	MSVCR100D		0x612589ee	
      2	abort	MSVCR100D		0x6133433e	
      3	wassert	MSVCR100D		0x61325647	
      4	CPlusPlus::SymbolTable::enterSymbol	Scope.cpp	118	0x5b021594	
      5	CPlusPlus::Scope::addMember	Scope.cpp	252	0x5b021cb8	
      6	CPlusPlus::Scope::Scope	Scope.cpp	239	0x5b021b82	
      7	CPlusPlus::Class::Class	Symbols.cpp	673	0x5b03a7ac	
      8	CPlusPlus::CloneSymbol::visit	Templates.cpp	281	0x5b0517ec	
      9	CPlusPlus::Class::visitSymbol0	Symbols.cpp	734	0x5b03ab4a	
      10	CPlusPlus::Symbol::visitSymbol	Symbol.cpp	131	0x5b0357e3	
      11	CPlusPlus::Symbol::visitSymbol	Symbol.cpp	140	0x5b035817	
      12	CPlusPlus::SymbolVisitor::accept	SymbolVisitor.cpp	33	0x5b03ff14	
      13	CPlusPlus::CloneSymbol::cloneSymbol	Templates.cpp	185	0x5b050faf	
      14	CPlusPlus::CloneSymbol::operator()	Templates.h	131	0x5b021387	
      15	CPlusPlus::Clone::symbol	Templates.cpp	490	0x5b0527fa	
      16	CPlusPlus::ClassOrNamespace::nestedType	LookupContext.cpp	918	0x5b09cafe	
      17	CPlusPlus::ClassOrNamespace::lookupType_helper	LookupContext.cpp	709	0x5b09b174	
      18	CPlusPlus::ClassOrNamespace::lookupType_helper	LookupContext.cpp	738	0x5b09b6d5	
      19	CPlusPlus::ClassOrNamespace::lookupType	LookupContext.cpp	648	0x5b09a887	
      ...	<More>
      

      Assert is when parsing line 2278 of qglobal.h.

      The crash can also be reproduced with following code segment:

      template <typename T>
      class QGlobalStatic
      {
      public:
          QBasicAtomicPointer<T> pointer;
          bool destroyed;
      };
      
      template <typename T>
      class QGlobalStaticDeleter
      {
      public:
          QGlobalStatic<T> &globalStatic;
          QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
              : globalStatic(_globalStatic)
          { }
      
          inline ~QGlobalStaticDeleter()
          {
              delete globalStatic.pointer;
              globalStatic.pointer = 0;
              globalStatic.destroyed = true;
          }
      };
      

      Attachments

        1. qglobal.h
          92 kB
        2. strippeddown.cpp
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes