[Bug c++/96720] New: ICE with* after include

2020-08-19 Thread cgnitash at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96720

Bug ID: 96720
   Summary: ICE with* after include
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cgnitash at gmail dot com
  Target Milestone: ---

The following code gives an ice on gcc trunk.

https://godbolt.org/z/5EaEGP


#include  *

[Bug c++/97846] New: No diagnostic for identifier label in constexpr gunction

2020-11-15 Thread cgnitash at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97846

Bug ID: 97846
   Summary: No diagnostic for identifier label in constexpr
gunction
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cgnitash at gmail dot com
  Target Milestone: ---

Reproduced from https://stackoverflow.com/questions/64852653

gcc fails to diagnose the use of an identifier label in a constexpr function:


constexpr void f() { x: ; }


clang does diagnose this violation.

Here's an online demo https://godbolt.org/z/1rjjhv

[Bug libstdc++/118665] New: std::uniform_int_distribution infinite loop with generator returning 0

2025-01-26 Thread cgnitash at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118665

Bug ID: 118665
   Summary: std::uniform_int_distribution infinite loop with
generator returning 0
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cgnitash at gmail dot com
  Target Milestone: ---

Passing a custom generator that always returns 0 to
std::uniform_int_distrubtion causes it to hang (presumably due to an
infinite loop)



#include 

class Gen {
public:
  using result_type = std::mt19937::result_type;
  Gen() : rng(0) {}
  static constexpr result_type min() { return std::mt19937::min(); }
  static constexpr result_type max() { return std::mt19937::max(); }

  // always return 0
  result_type operator()() { return 0; }

private:
  std::mt19937 rng;
};

int main() {
Gen g;
std::uniform_int_distribution dist(0, 42);
return dist(g);  // hangs
}



This only happens when operator() returns exactly 0.

libc++ doesn't have this issue. 

Demo: https://godbolt.org/z/E8M5dhE59