This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/37142] New: [4.2/4.3 Regression] ICE: in dependent_type_p, at cp/pt.c:15585


g++ version information:
works on 
  g++-4.1 (GCC) 4.1.3 20080308 (prerelease) (Ubuntu 4.1.2-21ubuntu1)
  Comeau 4.3.10.1
  icc 10.1

fails to work on 
  g++ (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
  g++ (Ubuntu 20080404-0ubuntu1) 4.3.1 20080404 (prerelease) [gcc-4_3-branch
revision 133917]
  g++ (Ubuntu 20080607-0ubuntu1~ppa1) 4.3.1 (A test package containing the
4.3.1 official release)*
  g++ (GCC) 4.3.2 20080814 (prerelease) (compiled from source snapshot)

*http://ppa.launchpad.net/ubuntu-toolchain/ubuntu/pool/main/g/gcc-snapshot/

I'll use the 4.3.2 prerelease branch for the error.
aharley@aharley-desktop:~/proj/yafft$ ~/opt/gcc-snapshot/bin/g++ testcase.cpp
testcase.cpp: In function ?int main(int, char**)?:
testcase.cpp:44: internal compiler error: in dependent_type_p, at cp/pt.c:15585

Code to reproduce is 
**** code starts ****
static long s_value = 0l;

template<typename A,
         const A a,
         template <typename _A, _A _a> class AA>
struct A_struct {
  void
  fn(typename AA<A, a>::t& a_) {
    a_.fn();
  }
};

template<typename B,
         const B b,
         class VALUE_OPS>
struct B_impl {
  void
  fn() {
    s_value = VALUE_OPS::fn(b);
  }
};

struct value_ops {
  static inline long fn(const long l) { return l+1l; }
};

template<typename B,
         const B b>
struct B_struct {
  typedef B_impl<B,
                 b,
                 value_ops> t;
};

#define VALTYPE long
#define VALVAL 0l

int main(int argc, char **argv) {
  B_struct<VALTYPE, VALVAL>::t b;
  A_struct<VALTYPE, VALVAL, B_struct> a;
  a.fn(b);
}
**** code ends ****


-- 
           Summary: [4.2/4.3 Regression] ICE: in dependent_type_p, at
                    cp/pt.c:15585
           Product: gcc
           Version: 4.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: annan dot h at gmail dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37142


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]