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++/53620] Compiler segfaults when compiling Digikam


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

--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-06-11 06:27:16 UTC ---
The attached testcase crashes in determine_visibility.
4.8 is also affected.

Here is an ugly testcase:

markus@x4 /tmp % cat test.ii
template<typename>class H;
template<typename _CharT, typename = int, typename = H<_CharT> >class A;
template<typename _Iterator>struct B {
  B(const _Iterator&);
};
template<typename _Tp>struct C {
  typedef _Tp *const_pointer;
  template<typename>struct D
  {
    typedef C other;
  };
};
template<typename _Tp>class H : public C<_Tp>{};
template<typename _CharT, typename _Traits, typename _Alloc>class A {
  typedef typename _Alloc::template D<_CharT>::other _CharT_alloc_type;
public:
  typedef typename _CharT_alloc_type::const_pointer const_pointer;
  typedef B<const_pointer>                          const_iterator;
};
int blank;
template<typename Iterator, typename Expr, typename Skipper,
         typename Attr>bool phrase_parse(Iterator, Expr, Skipper, Attr&)
{
  struct error_invalid_expression;
  typedef struct
  {
    int *error_invalid_expression::*assert_arg;
  }
  mpl_assert_arg156;
  enum
  {
    mpl_assertion_in_line_156 = mpl_assert_arg156::assert_arg
  };
}
class F {
  bool parseFile();
  struct G;
};
struct F::G
{
  static int ptoParser;
};
bool
F::parseFile()
{
  A<int>::const_iterator iter = 0, last = 0;
  bool result                 = phrase_parse(iter, last, G::ptoParser, blank);
  return result;
}

markus@x4 /tmp % g++ test.ii
test.ii: In instantiation of âstruct phrase_parse(Iterator, Expr, Skipper,
Attr&) [with Iterator = B<int*>; Expr = B<int*>; Skipper = int; Attr =
int]::mpl_assert_arg156â:
test.ii:33:3:   required from âbool phrase_parse(Iterator, Expr, Skipper,
Attr&) [with Iterator = B<int*>; Expr = B<int*>; Skipper = int; Attr = int]â
test.ii:47:77:   required from here
test.ii:27:37: internal compiler error: Segmentation fault
     int *error_invalid_expression::*assert_arg;
                                     ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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