[Bug c++/34229] error on correct code

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 25 20:46:00 GMT 2007



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-11-25 20:46 -------
I don't think this is valid code.  There is no definition for the is_const part
for the template where bind_return is in the anonymous namespace.  The code was
diagnose before that date but it was not rejected because GCC did not diagnose
the issue before.  We are diagnosing the invalid code now (which does not have
to be diagnose according to the C++ standard).

Please read PR 34094 also.

Basically it comes down to (which is not rejected but should be but that is a
different bug):
template <class a>  struct c
{
  static const bool t = 1;
};

namespace {
  struct b{};
}

int main(void)
{
  return c<b>::t;
}


-- 


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



More information about the Gcc-bugs mailing list