[Bug c++/61936] template template friends fail to compile.

2018-01-24 Thread hr.jonas.hansen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61936

hr.jonas.hansen at gmail dot com changed:

   What|Removed |Added

 CC||hr.jonas.hansen at gmail dot 
com

--- Comment #4 from hr.jonas.hansen at gmail dot com ---
The bug has been resolved with version 6.2

See:
https://godbolt.org/g/wrSDRG

[Bug c++/78907] New: internal compiler error segmentation fault with recursive constexpr

2016-12-22 Thread hr.jonas.hansen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78907

Bug ID: 78907
   Summary: internal compiler error segmentation fault with
recursive constexpr
   Product: gcc
   Version: 6.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hr.jonas.hansen at gmail dot com
  Target Milestone: ---

I recently updated my g++ version to 6.3.0 (g++ (Homebrew GCC 6.3.0) 6.3.0),
but now i get the following error:

g++: internal compiler error: Segmentation fault: 11 (program cc1plus). 

With the previous version (I'm not completely sure but around) 5.2 everything
worked. And on of my other computers I use g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1
and that also works.

The code is:

constexpr bool checkForPrimeNumber(const int p, const int t)
{
return p <= t or (p % t and checkForPrimeNumber(p, t + 2));
}

constexpr bool checkForPrimeNumber(const int p)
{
return p == 2 or (p & 1 and checkForPrimeNumber(p, 3));
}

int main() 
{
static_assert(checkForPrimeNumber(65521), "bug...");
}


I compile the code with:
g++ test.cpp -std=c++11 -fconstexpr-depth=65535

[Bug c++/78907] internal compiler error segmentation fault with recursive constexpr

2016-12-22 Thread hr.jonas.hansen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78907

--- Comment #2 from hr.jonas.hansen at gmail dot com ---
This is not an issue with g++ 5.2.1, did the default stack size change?
There is actually no need for using 65536 even -fconstexpr-depth=26000 will
ensure the crash, on my computer.
How do I change the stack size?

- Jonas

[Bug c++/61936] template template friends fail to compile.

2015-07-15 Thread hr.jonas.hansen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61936

hr.jonas.hansen at gmail dot com changed:

   What|Removed |Added

 CC||hr.jonas.hansen at gmail dot 
com

--- Comment #3 from hr.jonas.hansen at gmail dot com ---
The the errors remain under gcc 5.1.0.


[Bug c++/108536] New: Difference when using requires and enable_if with class constructor

2023-01-25 Thread hr.jonas.hansen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536

Bug ID: 108536
   Summary: Difference when using requires and enable_if with
class constructor
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hr.jonas.hansen at gmail dot com
  Target Milestone: ---

In the code below I have used a requires-clause. This requires-clause used to
be an enable_if. When using enable_if the code compiles without errors, but
using the requires-clause (see below) causes a compilation error when combined
with the rest of the example. That is, the example contains two classes ClassA
and ClassB. If either of the classes ClassA and ClassB are removed then the
code compiles without errors.


Compile with: g++ -std=c++20 example.cpp



#include 

struct Base {
Base() noexcept = default;

template >
// If this requires-clause is replaces with an enable_if then the code
compiles fine
requires(!std::is_same_v
 && std::is_constructible_v)
Base(F&&) {}
};

struct Derived : public Base {
using Base::Base;
void operator()() const;
};

class ClassA {
// The class ClassB must be present for the bug to manifest
class ClassB;

// This is the only usage of 'Derived'
Derived const f;
};

// This class and its contructor must be included for the bug to manifest
class ClassA::ClassB {
ClassB();
};

[Bug c++/108536] Difference when using requires and enable_if with class constructor

2023-01-25 Thread hr.jonas.hansen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536

--- Comment #2 from hr.jonas.hansen at gmail dot com ---
I can see that, and that would work. But it really seems like a work-around? Is
there a reason for the difference in behavior?