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

QtCreator crashes as soon as i open the attached C++ file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • Qt Creator 4.0.0-rc1
    • Qt Creator 3.6.1, Qt Creator 4.0.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • qt-creator-opensource-windows-x86-4.0.0-rc1
      mingw64
      Windows 10 Home (64bits)

    Description

      // C++ file that causes QtCreator crash

      enum foo_t { A, B, C, D };
      
      constexpr foo_t parent_of(const foo_t f) { return (f < D) ? static_cast<foo_t>(f+1) : D; }
      
      template <typename T>
      union index_ptr_t {
          unsigned int index;
          const T* ptr;
      };
      
      template <foo_t> struct Dummy;
      
      namespace impl {
      
      template <foo_t f>
      struct dummy_impl {
          index_ptr_t<Dummy<parent_of(f)>> parent;
      };
      
      template <>
      struct dummy_impl<D> {};
      
      }  // namespace impl
      
      template <foo_t f>
      struct Dummy : impl::dummy_impl<f> {};
      
      struct DummiesSet {
          index_ptr_t<Dummy<A>> a;
          index_ptr_t<Dummy<B>> b;
          
          void operator=(const Dummy<A>* _a) {
              a.ptr = _a;
              b.ptr = a.ptr->parent.ptr;
          }
      };
      

      Attachments

        1. backtrace.txt
          81 kB
        2. sample.cpp
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            nikopol Nelson Seco
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes