[Bug bootstrap/105298] New: GCC-12-20220410 FTBFS for --enable-languages=[c,c++,]d: configure: error: can't compile D sources!: gcc/d21: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found

2022-04-17 Thread kdevel at vogtner dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105298

Bug ID: 105298
   Summary: GCC-12-20220410 FTBFS for
--enable-languages=[c,c++,]d: configure: error: can't
compile D sources!: gcc/d21:
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.29'
not found
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kdevel at vogtner dot de
  Target Milestone: ---

Different from GCC 11.2 GCC 12 does not seem to build gdc without having
already a gdc installed. In order to overcome this I use a GCC 11.2 which is
installed in a non-std. For this puropose I set

   PATH=:$PATH
   export LD_RUN_PATH=/lib64:/lib

before

   gcc-12-20220410/configure --prefix=$inst --enable-languages=c,c++,d

where $inst ist a non-std. directory.

   make bootstrap

then fails with error 2 and

   configure: error: can't compile D sources!

This is caused by gcc/d21 in the objdir referencing /usr/lib64/libstdc++.so
instead of /libstdc++.so, which is caused by RPATH
set to $inst/lib64 instead of /lib64.

[Bug c++/43943] "warning: no return statement in function returning non-void" should be an error

2022-04-19 Thread kdevel at vogtner dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43943

Stefan  changed:

   What|Removed |Added

 CC||kdevel at vogtner dot de

--- Comment #8 from Stefan  ---
(In reply to Jonathan Wakely from comment #4)
> There are cases which are either not diagnosable or cannot be
> written, such as this example from Doug Gregor:
> 
> in generic code, there might not be a way to create a value with the
> appropriate type. For example:
> 
>template
>T maybe_call(std::function f) {
>if (f)
>return f();
>else
>abort_program();
> 
>// Cannot write a return here, because we have no way to
> create a value of type 'T'
>}

One can of course write a return there:

   template
   T maybe_call(std::function f)
   {
  if (f)
 return f();
  else
 abort_program();

  // Cannot write a return here, because we have no way to create a value
of type 'T'
  return f();
   }

which refactors nicely into

   template
   T maybe_call(std::function f)
   {
  if (! f)
 abort_program();
  return f();
   }