Giter VIP home page Giter VIP logo

constainer's People

Contributors

arcoth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sarrow104

constainer's Issues

GCC ICEs on ChunkPool testcase

constexpr auto d() {
    ChunkPool<int, 17> c;
    int* ptr = c.grab();
    assert( c.used() == 1 );
    c.free(ptr);
    return 0;
}
static_assert( d() == 0 );

Leads to an ICE with trunk 20150813; has been reported as #66292 and reduced to #66460.

StableVector - access to temporary whose lifetime has ended

This issue occurs in e.g. the following scenario:

constexpr auto f() {return StableVector<int, ChunkPool<int, 10>>{1};}
static_assert( f()[0] );

Clang's error message:

….cxx:4:16: error: static_assert expression is not an integral constant expression
static_assert( f()[0] );
               ^~~~~~
….cxx:4:16: note: read of temporary whose lifetime has ended
….cxx:3:28: note: temporary created here
constexpr auto f() {return StableVector<int, ChunkPool<int, 10>>{1};}
                           ^

Whether this is a bug or not isn't entirely clear, but the former is probably the case, as e.g. AddressSanitizer doesn't show anything.

GCC fails Array comparison testcase

constexpr Array<int, 10> a {{1, 2, 3, 4, 5}};
constexpr Array<int, 10> a2{{1, 2, 3, 4, 5}};
static_assert( a == a2 );

Fails with GCC trunk 20150813:

Constainer/Testing.cxx:23:1: error: non-constant condition for static assertion
 static_assert( a == a2 );
 ^
In file included from Constainer/impl/../Array.hxx:7:0,
                 from Constainer/impl/BasicVector.hxx:7,
                 from Constainer/String.hxx:8,
                 from Constainer/Parser.hxx:7,
                 from Constainer/Testing.cxx:7:
Constainer/Testing.cxx:23:18:   in constexpr expansion of ‘Constainer::operator==<int, 10ul, int, 10ul>(a, a2)’
Constainer/impl/../Array.hxx:89:14:   in constexpr expansion of ‘Constainer::equal<const int*, const int*>((& lhs)->Constainer::Array<T, Size>::begin<int, 10ul>(), (& lhs)->Constainer::Array<T, Size>::end<int, 10ul>(), (& rhs)->Constainer::Array<T, Size>::begin<int, 10ul>(), (& rhs)->Constainer::Array<T, Size>::end<int, 10ul>())’
Constainer/impl/../Algorithms.hxx:269:26:   in constexpr expansion of ‘Constainer::equal<const int*, const int*, std::equal_to<void> >(first1, last1, first2, last2, (std::equal_to<void>(), std::equal_to<void>()))’
Constainer/impl/../Algorithms.hxx:264:31:   in constexpr expansion of ‘Constainer::mismatch<const int*, const int*, std::equal_to<void> >(first1, last1, first2, last2, (comp, std::equal_to<void>()))’
Constainer/impl/../Algorithms.hxx:220:2: error: ‘(((const int*)(& a.Constainer::Array<int, 10ul>::_storage)) == (((const int*)(& a.Constainer::Array<int, 10ul>::_storage)) + 40u))’ is not a constant expression
  while (first1 != last1 && first2 != last2) {
  ^

Reduces to

struct A {int arr[3] {1, 2, 3};} constexpr a{};
static_assert( a.arr != a.arr+3 );

Reported as #67380, dup of #67376.

GCC complains about partial specializations of Parser::handleFormatSpecifier

GCC spits out a bunch of error messages corresponding to all partial specializations of handleFormatSpecifier:

…/StaticPrintf.hxx:412:9: error: template argument ‘Tokens::      character’ involves template parameter(s)
struct handleFormatSpecifier<Tokens::character, ch...> : handleRest<ch...> {
                             ^

GCC doesn't properly distinguish between template parameters of a member template and the surrounding template when testing validity of specialized non-type arguments in partial specializations. Filed as #67593.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.