Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
```cpp
template
struct Base {};
template
struct Derived: Base {
Derived(Derived::Base obj);
};
```
Accessing Base via Derived works with clang and MSVC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104850
--- Comment #7 from Benjamin Buch ---
Sorry wrong number; Bug 114076
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104850
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114076
--- Comment #3 from Benjamin Buch ---
I [created an overview](https://stackoverflow.com/a/78101462/4821621) with all
cases that currently work on StackOverflow. I think that all these cases should
be valid. For a properly formated version with
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
I come from this Bug Report to Visual C++:
- https://github.com/microsoft/STL/issues/4417
I think that GCC has
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109299
Benjamin Buch changed:
What|Removed |Added
Version|12.0|12.1.0
--- Comment #3 from Benjamin
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
I run into this by using googletest with CMake in release mode.
```
#include
static std::wstring foo(std::wstring text
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104872
--- Comment #4 from Benjamin Buch ---
Can you please increase the priority? P3 seems too low for the wrong code. With
ICE I could understand that, but here the code seems to be compiled
successfully and then crashes when running the program.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104872
--- Comment #3 from Benjamin Buch ---
Bug is still present in GCC 12.1 and current trunk.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104872
--- Comment #2 from Benjamin Buch ---
To workaround it is enough define the wrapper constructor to build a string.
```cpp
wrapper(std::string text): filename(std::move(text)) {}
```
https://godbolt.org/z/9za7hfjs8
```cpp
#include
#include
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104872
--- Comment #1 from Benjamin Buch ---
More minimal version:
https://godbolt.org/z/aEv13e38a
```cpp
#include
#include
#include
using namespace std::literals;
class logging_string{
public:
logging_string(std::string_view text)
: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
The bug affects all versions of GCC 11 and trunk (upcoming version 12).
The following minimal example causes a crash during memory freeing. However,
the error seems
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90101
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85200
Benjamin Buch changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85200
--- Comment #1 from Benjamin Buch ---
Another version of the ICE is:
struct B{
constexpr operator bool(){ return 1; }
};
template < typename >
void f(){
[](auto v, auto b){
if constexpr(b){
auto x = [](auto){ return
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct A{
constexpr operator int(){ return 0; }
};
template < typename >
void f(){
[](auto known){
if constexpr(constexpr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72752
--- Comment #14 from Benjamin Buch ---
The test case from comment 11 is now bug 84678.
The other 4 test cases are known to successfully compile on GCC 6 and GCC 7
branch and current trunk (GCC 8). They are also known to compile with the
current
++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
This was previously part of the Bug 72752 comment 11.
template< typename >
struct Outer{
template< typename >
struct Inner;
};
template<>
template<
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72752
--- Comment #13 from Benjamin Buch ---
I will create a separate bug report in the next hour. (After testing the test
cases against the current trunk.)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84469
--- Comment #2 from Benjamin Buch ---
Yes, of course not, sorry! Copy and paste failure, thanks for correcting.
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct A{
template < typename T >
void f()const{}
};
template < typename >
void foo(){
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct A{
constexpr operator bool()const{ return true; }
};
int main(){
auto f = [](auto v){ if constexpr(v
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84420
--- Comment #1 from Benjamin Buch ---
Same with:
int main(){
[]{
int a[1]{};
auto [v] = a;
(void)v;
}();
}
$ g++ -std=c++17 main.cpp
main.cpp: In lambda
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
int main(){
int a[1]{};
[]{
auto [v] = a;
(void)v;
}();
}
$ g++ -std=c++17
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84368
--- Comment #4 from Benjamin Buch ---
I can still reproduce it on R257659:
$ g++ -std=c++14 main.cpp
main.cpp: In instantiation of 'foo(T ...) [with T = {int}]:: [with auto:1 = {int}]':
main.cpp:9:6: required from 'void
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84368
--- Comment #3 from Benjamin Buch ---
I'm on git commit a5283f322810189a156a0fb080bf6d65e6f7970e which should be
R257627.
I used:
$ git svn find-rev $(git log --max-count 1 --pretty=format:%H)
Migrating from a git-svn v1 layout...
Data from a
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename ... T >
void sink(T ...){}
template < typename ... T >
void foo(T ... v){
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename ... T >
auto f(T ... i){
[](auto ... i){
// // wrongly true in current
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename T > void f(T ...){}
int main(){
f(0);
}
T is not an parameter pack, but expansion is wrongly ac
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84036
Benjamin Buch changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84181
--- Comment #6 from Benjamin Buch ---
Yet another version:
template < typename T >
auto var = [](auto ... i){ [i ...]{}; }();
int main(){
var< int >;
}
$ g++ -std=c++14 main4.cpp
main4.cpp: In instantiation of '
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84181
--- Comment #5 from Benjamin Buch ---
I'm not completely sure anymore whether this is related, another version of the
new bug is:
template < typename ... T >
void sink(T ...){}
template < typename T >
auto var = [](auto ... i){ sink(i + 0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84126
Benjamin Buch changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84126
Benjamin Buch changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84181
Benjamin Buch changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIXED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename ... T > void sink(T ...){}
template < typename >
void f(){
auto const lam
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84181
--- Comment #1 from Benjamin Buch ---
Same with:
template < int ... I >
struct A{};
template < typename T >
void f(){
[](auto ... i){
return A< decltype(i)::x ... >{};
};
}
int main(){
f< int >();
}
$ g++ -std=c++14
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
This is a very serious regression because it affects Boost.Hana directly.
template < int ... I >
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template
void bar(T&){} // ICE with reference,
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct X{ constexpr operator bool()const{ return true; } };
int main(){
[](auto
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct A{};
template < typename >
struct Test{
static constexpr auto var = []{};
};
int main(){
(voi
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
Older versions of g++ compile this successfully, g++-8 fails with an ICE:
template < typename T >
au
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82249
--- Comment #5 from Benjamin Buch ---
The code is accepted by clang since version 4.0. Older versions probably don't
support constexpr lambdas.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82152
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82249
--- Comment #3 from Benjamin Buch ---
Bug is still present in trunk.
$ g++ --version
g++ (GCC) 8.0.0 20180103 (experimental)
Copyright (C) 2018 Free Software Foundation, Inc.
ty: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
constexpr int f(){
if(true) return 0;
throw 0;
}
int main(){
constexpr auto i = f();
}
Probably related to Bug 6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81676
--- Comment #2 from Benjamin Buch ---
Does still exist in:
$ g++ --version
g++ (GCC) 8.0.0 20171201 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82249
--- Comment #2 from Benjamin Buch ---
The ICE is fixed in trunk, but the wrong argument pack lengths mismatch does
still exist:
constexpr auto calc = [](auto, auto dim)noexcept{ return dim; };
template < typename ... Ds >
constexpr auto f(Ds
++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename ... Ds >
constexpr auto f(Ds ...)noexcept{
return [](auto ... n){
constexpr auto calc =
[](auto n, auto dim)noexcept{
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
int main(){
int dummy = 0;
[](auto& d, auto ... args){
([](auto ...){}(([](){}, args)), ...);
}(dummy,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72752
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71527
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66639
--- Comment #11 from Benjamin Buch ---
Also test case #3 doesn't work if you declare the function return type auto:
constexpr auto foo ()
{
static_assert (0 == __builtin_strcmp (__func__, "foo"), "#1");
static_assert (0 == __builtin_strcmp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81486
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < typename T >
int f(T v){
if constexpr(sizeof(T) == sizeof(int)){
return v;
}else{
re
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81507
--- Comment #5 from Benjamin Buch ---
Yes, but in a long list of template heavy calls it is not trivial to see it, if
you don't expect such an error in your code.
It would be nice to have something like the 'did you mean …' hints, if an
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81507
Benjamin Buch changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Component|libstdc++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81507
--- Comment #2 from Benjamin Buch ---
Same with clang, and I found the reason:
Since the first argument is std::vector, the function std::apply is called
instead of my apply function …
So it's not a bug. But maybe you can add some kind hint
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80165
--- Comment #4 from Benjamin Buch ---
Sorry, wrong thread!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80165
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81507
--- Comment #1 from Benjamin Buch ---
Same with:
$ /home/bebuch/media/programme/gcc-7/bin/g++ --version
g++ (GCC) 7.1.1 20170721
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
I ran into a very strange bug:
#include
#include
#include // must include map to trigger the error!!!
template < typename A, typename B >
void apply(A const&
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
template < int I > struct int_{};
template < typename T >
struct A{
template < typename U, int I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66256
--- Comment #4 from Benjamin Buch ---
Same with decltype instead of noexcept:
struct test{
// it only works if e is declared before test()
using type = decltype(e);
static const bool e = false;
};
$ g++ -std=c++11 gcc-bug.cpp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66256
Benjamin Buch changed:
What|Removed |Added
CC||benni.buch at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78301
--- Comment #3 from Benjamin Buch ---
No, it isn't.
$ g++ -std=c++11 -o a a.cpp
a.cpp:3:41: error: invalid use of 'this' at top level
void outer() const noexcept( noexcept( this->inner() ) ) {
tested with:
$ g++ --version
g++ (GCC) 7.0.1
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
struct A{
void get(){}
void f()noexcept(noexcept(get())){}
};
int main(){}
Should
++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
#include
int main(){
std::variant v(5);
std::visit([](int&){}, v);
std::visit([](int&&){}, std::move(v));
}
Should be a valid program,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71527
--- Comment #1 from Benjamin Buch ---
I simplified the example code:
// Example ==
// A compile time int-type
template < int I >
struct size{};
// The problem:
template < typename T, int N >
void f(size< N
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: benni.buch at gmail dot com
Target Milestone: ---
// Example ==
// Convert C-String to int
template < int N >
constexpr int parse_int(char con
71 matches
Mail list logo