Hi all,
  Right now the trunk does not compile with GCC 4.4.7 (the GCC that
comes with CentOS 6; yes I know old) after revision 277200 (October
19).
The error message is:
../../gcc/gcc/cp/cvt.c:1043: error: operands to ?: have different
types ‘escaped_string’ and ‘const char [1]’
../../gcc/gcc/cp/cvt.c:1060: error: operands to ?: have different
types ‘escaped_string’ and ‘const char [1]’

Is it acceptable to put in a workaround for this?

Thanks,
Andrew Pinski

PS  A simplified testcase which shows the issue:
#include <cstddef>
#include <stdlib.h>

class escaped_string
{
 public:
  escaped_string () { m_owned = false; m_str = NULL; };
  ~escaped_string () { if (m_owned) free (m_str); }
  operator const char *() const { return m_str; }
  void escape (const char *);
 private:
  escaped_string(const escaped_string&) {}
  escaped_string& operator=(const escaped_string&) { return *this; }
  char *m_str;
  bool  m_owned;
};

void f(void)
{
  escaped_string a;
  const char *b = a ? a : "";
}

Reply via email to