[Bug c++/84441] New: Internal compiler error

2018-02-18 Thread egil.brendsdal at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Bug ID: 84441
   Summary: Internal compiler error
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: egil.brendsdal at gmail dot com
  Target Milestone: ---

Created attachment 43450
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43450&action=edit
Preprocessed source code.

gcc 4.x and gcc 5.x compiles the following snippet, version 6.x and 7.x fails.

The compiler output is

/tmp/bug_report.cpp: In constructor 'derived::derived(int)':
/tmp/bug_report.cpp:15:84: internal compiler error: in assign_temp, at
function.c:968
 ( int n ) : base( n>=0 ? make_base( 1, n ) : make_base( -1, (size_t)0-n ) ) {
}
   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccye5Pzm.out file, please attach this to
your bugreport.

+===+

#include 

struct base
{
  typedef std::string string;

  string r;
  inte;
};

base make_base( int, size_t n );

struct derived : public base
{
  derived( int n ) : base( n>=0 ? make_base( 1, n ) : make_base( -1,
(size_t)0-n ) ) { }
};

derived f() { return derived(1); }

[Bug c++/103250] New: Valarray replacement type introduces ambiguity

2021-11-15 Thread egil.brendsdal at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103250

Bug ID: 103250
   Summary: Valarray replacement type introduces ambiguity
   Product: gcc
   Version: 10.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: egil.brendsdal at gmail dot com
  Target Milestone: ---

Version/System/Options:

Using built-in specs.
COLLECT_GCC=/usr/pkg/gcc10/bin/gcc
COLLECT_LTO_WRAPPER=/usr/pkg/gcc10/libexec/gcc/x86_64-redhat-linux/10.3.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../gcc-10.3.0/configure --disable-libstdcxx-pch --enable-nls
--with-libiconv-prefix=/usr --enable-__cxa_atexit
--with-gxx-include-dir=/usr/pkg/gcc10/include/c++/ --disable-multilib
--enable-libssp --enable-languages='c obj-c++ objc fortran c++' --enable-shared
--enable-long-long --with-local-prefix=/usr/pkg/gcc10 --enable-threads=posix
--with-boot-ldflags='-static-libstdc++ -static-libgcc
-Wl,-R/usr/pkg/gcc8/lib/gcc/x86_64-redhat-linux/8.4.0 -Wl,-R/usr/pkg/gcc8/lib64
-Wl,-R/usr/pkg/lib  ' --with-system-zlib --without-zstd --with-arch=nocona
--with-tune=nocona --with-fpmath=sse --prefix=/usr/pkg/gcc10
--build=x86_64-redhat-linux --host=x86_64-redhat-linux
--infodir=/usr/pkg/gcc10/info --mandir=/usr/pkg/gcc10/man
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.0 (GCC) 


Command line:

/usr/pkg/gcc10/bin/c++ -std=c++17 gcc_bug.cpp

Compiler output:

gcc_bug.cpp: In instantiation of 'auto f(size_t) [with T = int; Q = tag; size_t
= long unsigned int]':
gcc_bug.cpp:38:37:   required from here
gcc_bug.cpp:33:11: error: ambiguous overload for 'operator/' (operand types are
'std::valarray >' and 'std::valarray >')
   33 |   return x/x;
  |  ~^~
In file included from gcc_bug.cpp:1:
/usr/pkg/gcc10/include/c++/valarray:1188:1: note: candidate:
'std::_Expr, typename std::__fun::result_type> std::operator/(const std::valarray<_Tp>&, const
std::valarray<_Tp>&) [with _Tp = qaz::num; typename
std::__fun::result_type = qaz::num]'
 1188 | _DEFINE_BINARY_OPERATOR(/, __divides)
  | ^~~
gcc_bug.cpp:23:58: note: candidate: 'std::valarray
qaz::operator/(const std::valarray >&, const
std::valarray >&) [with T = int; Q1 = tag; Q2 = tag; decltype
((x[0] / y[0])) = int]'
   23 |   template < typename T, typename Q1, typename Q2 > auto operator/(
const std::valarray< num > &x, const std::valarray< num > &y ) ->
std::valarray< decltype(x[0]/y[0]) >;
  |  ^~~~


File generated by -save-temps is attached.

[Bug c++/103250] Valarray replacement type introduces ambiguity

2021-11-15 Thread egil.brendsdal at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103250

--- Comment #1 from Egil Brendsdal  ---
Created attachment 51797
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51797&action=edit
Preprocessed source code, gzip