------- Comment #6 from pinskia at gcc dot gnu dot org  2005-12-24 16:15 -------
An ever better example comes from PR 25555:
#include <iostream>

using std::cerr;
using std::endl;

template <typename X>
struct test
{
  static int const r = 0;
};

template <typename X>
struct test<X&>
{
  static int const r = 1;
};

template <typename X>
struct test<X*>
{
  static int const r = 2;
};

int
main ()
{
  int i;
  int& ri = i;
  cerr << test<typeof (ri)>::r << endl;
}

This should print 1 but instead prints 0.


-- 


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

Reply via email to