Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-09-14 23:46:28


Boosters,

I posted some time ago about what seemed to be a bug in Metrowerks's
CodeWarrior 8.3 compiler that was standing in the way of complete
functionality of the upcoming Variant library (namely reference content for
variants). I have not yet found a workaround, but I have more precisely
identified the problem.

The problem can be reproduced by attempting to compile the code shown below.
Note that this code successfully compiles on at least the following
compilers: MSVC 7.1, gcc 2.95 and up, Borland 5.51, and Comeau 4.3 and up.

Any help would be greatly appreciated. Also, it might be worthwhile
introducing a new defect macro to the config library.

Thanks,
Eric

---
  struct test_t
  {
      template <typename T>
      test_t(T&)
      {
      }
      template <typename T>
      test_t(const T&)
      {
      }
  };
  void test_impl(test_t)
  {
  }
  template <typename T>
  void test()
  {
      T t;
      T & x = t;
      test_impl(x);
      T const & cx = x;
      test_impl(cx); // CW8.3: compile error here
  }
  int main()
  {
      test< int >();
      return 0;
  }

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk