[Bug c++/92082] New: ICE with concepts

2019-10-13 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92082

Bug ID: 92082
   Summary: ICE with concepts
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

The compiler ICEs with a segmentation fault with the following code:

#include 
#include 

template  class ttp, class c>
struct resolve {static constexpr bool value = false; };

template  class ttp, class ... ts>
struct resolve>{static constexpr bool value = true; };

template < class c, template  class ttp>
concept instanceof = resolve::value;

int main()
{
instanceof auto x = std::array{1, 2, 3};
}


godbolt: https://gcc.godbolt.org/z/99WWSW

[Bug libstdc++/83860] New: valarray replacement type breaks with auto and more than one operation

2018-01-15 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83860

Bug ID: 83860
   Summary: valarray replacement type breaks with auto and more
than one operation
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

The following code results in a segmentation fault:

int main()
{
std::valarray va(16), vb(16), vc(16);

auto sum = va + vb + vc;

valarray vsum = sum;
}

If one of the 3 operands is removed from the sum, the code appears to work.

[Bug libstdc++/83860] [6/7/8 Regression] valarray replacement type breaks with auto and more than one operation

2018-01-16 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83860

--- Comment #2 from Bruno Manganelli  ---
Just to clarify, it still segfaults when using clang++ with libstdc++.

[Bug c++/91122] New: alignas gives up evaluating a constant expression in template context

2019-07-09 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91122

Bug ID: 91122
   Summary: alignas gives up evaluating a constant expression in
template context
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

The following code:


template 
constexpr T min( const T& a, const T& b)
{
return a < b ? a : b;
}
template 
constexpr unsigned long alignment()
{
return min(sizeof(T), N);
}
template 
struct alignas(alignment()) foo {};

int main()
{
foo f;
}

fails to compile on gc 9.1, but worked on previous releases and works again on
trunk: https://gcc.godbolt.org/z/0dSqva

I'm just wondering if the fix will be backported to gcc 9.2

[Bug c++/87970] New: Template Instantiation from empty parameter pack is not diagnosed in class specialization

2018-11-10 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87970

Bug ID: 87970
   Summary: Template Instantiation from empty parameter pack is
not diagnosed in class specialization
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

The following code compiles with g++ 8.1+, but fails with all the other
compilers which claim that we are trying to pass too many template arguments to
bar.

template 
struct bar {};

template 
struct foo {};

template 
struct foo> {};

godbolt link: https://gcc.godbolt.org/z/pnyPvn

[Bug c++/77755] New: [concepts] Abbreviatd function template pack expansions not working

2016-09-27 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77755

Bug ID: 77755
   Summary: [concepts] Abbreviatd function template pack
expansions not working
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

Pack expansions are not handled correctly in the context of abbreviated
function templates. For example, foo in 

template  struct S{};

template 
concept bool Integral = std::is_integral::value;

int foo (S)
{
return 0;
}

fails to compile with the error: expansion pattern 'auto:1' contains no
argument packs

[Bug c++/66210] New: Variable template specialization does not work with alias-declarations

2015-05-19 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66210

Bug ID: 66210
   Summary: Variable template specialization does not work with
alias-declarations
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

Created attachment 35571
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35571&action=edit
testcase

In code such as the following, alias-declarations causes a variable to be
instantatiated from the non-specialized variable template

using resultType = const char*;

template
T pi = (T)(3.1415926535897932385);

template<>
resultType pi = "pi";

NOTE: using a typedef does not generate the same error and the code compiles


[Bug c++/66210] Variable template specialization does not work with alias-declarations

2015-05-19 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66210

Bruno Manganelli  changed:

   What|Removed |Added

   Severity|minor   |normal


[Bug c++/66266] New: Abbreviated function template does not behave as expected

2015-05-23 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66266

Bug ID: 66266
   Summary: Abbreviated function template does not behave as
expected
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bruno.manga95 at gmail dot com
  Target Milestone: ---

Although abbreviated function templates are not part of ISO c++14 (but part of
the Concepts ts), the following code does not behave as its equivalent function
template (as described in n4377 section 8.3.5) and the assertion fails:

auto sum_auto(auto x, auto y)
{
return x+y;
}

template 
auto sum_template(T x, U y)
{
return x+y;
}

int main()
{
   //sum_auto returns 10 while sum_template returns 10.1
assert(sum_auto(5, 5.1) == sum_template(5, 5.1)); 
}


[Bug c++/66266] Abbreviated function template does not behave as expected

2015-05-23 Thread bruno.manga95 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66266

--- Comment #1 from Bruno Manganelli  ---
Probably another symptom of 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64969

as inverting the arguments for auto_sum does not cause the assertion to fail.
Apologies for the duplicate.