Thread overview | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 06, 2006 [bug 8.49.2] | ||||
---|---|---|---|---|
| ||||
This code snippet works under Intel 7.0 and Comeau Online, fails to compile under the latest beta. It is trimmed down dynamic_bitset example from Boost. ----------------------------------------------------------------- namespace boost { namespace detail { template <typename T> struct dynamic_bitset_allowed_block_type { enum { value = T(-1) > 0 }; // ensure T has no sign <<<=== here it fails }; } // namespace detail // static assert support template <bool x> struct STATIC_ASSERTION_FAILURE; template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; }; template<int x> struct static_assert_test{}; template<typename Block = unsigned long> class dynamic_bitset { typedef ::boost::static_assert_test < sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool) ( detail::dynamic_bitset_allowed_block_type<Block>::value ) >) > boost_static_assert_typedef_999; public: dynamic_bitset(unsigned num_bits, unsigned long value = 0) {} }; } // namespace boost int main() { boost::dynamic_bitset<> x(5); return 0; } -------------------------------------------------------------- It fails with some "invalid syntax" message: x.cpp(11) : Error: '}' expected Trying to find the minimal test I was able to provoke invalid generation of code (resulting in system dialog whether I wish to send error report to Redmond :). I do not know what value could such finding has, it is not minimal and requires using Boost headers. /Pavel |
July 06, 2006 Re: [bug 8.49.2] new (std::nothrow) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | This tiny snippet works on Intel and Comeau online (and should just everywhere): --------------------------------- #include <new> int main() { char* ch = new (std::nothrow) char[1]; return 0; } ------------------------------------- It comes from Boost.Pool. The error emitted is: x.cpp(8) : Error: no match for function '?_P(unsigned ,const std::nothrow_t)' /Pavel |
July 06, 2006 Re: [bug 8.49.2] yet one more | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | Following snippet compiles in Intel and online Comeau. DMC fails with error: x.cpp(26) : Error: 'tuple' is already defined --------------------------------------- struct nil_t {}; template <typename A = nil_t> struct tuple; template <typename DerivedT> struct tuple_base {}; template <> struct tuple<> : public tuple_base<tuple<> > {}; int main() { return 0; } -------------------------------------------- This was extracted from Boost.Spirit (the parser library). /Pavel |
July 07, 2006 Re: [bug 8.49.2] switching ADL off failure? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | This code snippet compiles in Comeau and Intel. ----------------------------------------- template<class T> class bbb { public: explicit bbb(T val) : n((val.max)()-(val.min)()) //<<<== here it fails, notice the parenthesis { } private: T::result_type n; }; struct ccc { typedef int result_type; int min() { return 0; } int max() { return 0; } }; int main() { ccc c; bbb<ccc> b(c); return 0; } -------------------------------------------------- In DMC it returns: x.cpp(6) : Error: type mismatch Had: bbb<ccc > and: ccc x.cpp(7) : Error: need explicit cast to convert from: bbb<ccc > to : int The problematic part are the parenthesis around "max.val" call as in (max.val)(). If the parenthesis are removed it compiles. I guess they are there in order to switch off any ADL lookup. The code is trimmed down snippet from failing Boost.Random. /Pavel |
July 07, 2006 Re: [bug 8.49.2] | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | Thanks for the new reports. Is the 8.49.2 beta at least getting further than 8.49.1? |
July 07, 2006 Re: [bug 8.49.2] | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright |
"Walter Bright" wrote:
> Is the 8.49.2 beta at least getting further than 8.49.1?
>
Yes, some Boost tests do work now.
The Boost official bug report still uses the
very old compiler - I was told they had switched
but nothing's visible so far.
I also tried to compile the STLport 5.10
said to support DMC: they have bugs in makefile.
/Pavel
|
July 07, 2006 Re: [bug 8.49.2] friend problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | This code compiles on Intel and Comeau. It is trimmed down problem with Boost.Operators and Boost.Serialization. ------------------------------------------- template <class T, class U> struct aaa { friend bool operator==(const U& y, const T& x) { return x == y; } }; struct bbb {}; struct ccc {}; int main() { aaa<bbb, ccc> a; return 0; } -------------------------------------------- /Pavel |
July 07, 2006 Re: [bug 8.49.2] | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | A bug courtesy of Boost.CRC. Intel + Comeau work here. --------------------------------------------- template< int T> struct uint_t; template < unsigned Bits, typename uint_t<Bits>::fast U > struct aaa {}; template <unsigned Bits> void foo(aaa<Bits, 1> *p); int main() { return 0; } -------------------------------------------- /Pavel |
July 07, 2006 Re: [bug 8.49.2] handy warning missing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | With code: ------------------------ int main() { return 0; return 0; } ----------------------- no warning is given although there's clear mistake. Comeau and BCB do emit error ("unreachable"), Intel doesn't. /Pavel |
July 07, 2006 Re: [bug 8.49.2] problem with arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Vozenilek | Works on Intel, Comeau: ----------------------------------- template< typename T, unsigned sz > inline T* range_begin( T (&array)[sz] ) { return array; } template< class T > inline void begin( T& r ) { range_begin( r ); } int main() { const int sz = 9; int my_array[sz] = { 1,2,3,4,5,6,7,8,9 }; begin( my_array ); return 0; } ---------------------------------------- I am not really sure what is the problem, possibly something with different rules for array decay on templates and non-templates. This is trimmed down problem from Boost.Range. Btw, compilation of Boost.Range (and Boost.String Algorithms that use Range) is veeery slow with DMC. The Intel 7.0 does compile some tests visibly faster. /Pavel |
Copyright © 1999-2021 by the D Language Foundation