[Bug c++/85039] [6/7/8 Regression] internal compiler error: in nested_anon_class_index, at cp/mangle.c:1626

2018-03-29 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85039

Alexandre Oliva  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||aoliva at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |aoliva at gcc dot 
gnu.org

--- Comment #3 from Alexandre Oliva  ---
Created attachment 43805
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43805=edit
candidate patch

Here's the patch I'm testing

[Bug c++/85027] [6/7/8 Regression] ICE on invalid C++ code: in instantiate_type, at cp/class.c:8062

2018-03-29 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85027

Alexandre Oliva  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||aoliva at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |aoliva at gcc dot 
gnu.org

--- Comment #3 from Alexandre Oliva  ---
Created attachment 43804
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43804=edit
candidate patch

Here's the patch I'm testing

[Bug c++/85128] New: Local scope type(def) falsely assumed to change meaning of outer scope type(def)

2018-03-29 Thread steffen at sdaoden dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85128

Bug ID: 85128
   Summary: Local scope type(def) falsely assumed to change
meaning of outer scope type(def)
   Product: gcc
   Version: 6.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: steffen at sdaoden dot eu
  Target Milestone: ---

Hi, my first post here.
So i have no idea, all i can say is what the subject says, that clang gets it
right, and here is the error message:

g++ -DNDEBUG -DOPTIMIZE -Wall -W -Wno-long-long -pedantic -fno-exceptions
-fno-rtti -DPIC -fpic -I./ -fomit-frame-pointer -O2 -c -o .obj/d2.o
src/smp/x_signal.cc
In file included from ./sf/sys/cp.h:30:0,
 from ./src/x_posix.h:133,
 from src/smp/x_signal.cc:46:
./sf/sys/coll/teacher.h:146:32: error: declaration of 'typedef class
SF::Sys::Coll::AutoToolbox SF::Sys::Coll::TypeTraits::AutoToolbox'
[-fpermissive]
  pub typedef AutoToolbox AutoToolbox;
^~~
In file included from ./sf/sys/coll/teacher.h:29:0,
 from ./sf/sys/cp.h:30,
 from ./src/x_posix.h:133,
 from src/smp/x_signal.cc:46:
./sf/sys/coll/forwards.h:61:25: error: changes meaning of 'AutoToolbox' from
'class SF::Sys::Coll::AutoToolbox' [-fpermissive]
 template class AutoToolbox;
 ^~~

[Bug c++/85127] New: Members implementation outside class doesn't compile if class name is an alias from a using

2018-03-29 Thread quen...@huot-marchand.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85127

Bug ID: 85127
   Summary: Members implementation outside class doesn't compile
if class name is an alias from a using
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: quen...@huot-marchand.fr
  Target Milestone: ---

Hello,

As I am coding with a coding style with a margin of 80 characters, I try to
minimize my length as much as possible with the use of "using".

The problem is well described here : https://godbolt.org/g/C2qQgL
As you can see it compile on clang and msvc

Apparently you can't do :

template 
class Base {
public:
void foo();
};

template 
using B = Base;

template 
void B::foo() {
}


But the standard seems to authorize it.

[Bug target/85126] New: [8 regression] gcc.target/powerpc/pr69946.c fails on powerpc64 BE starting with r254213

2018-03-29 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85126

Bug ID: 85126
   Summary: [8 regression] gcc.target/powerpc/pr69946.c fails on
powerpc64 BE starting with r254213
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

The rlwinm the test case is expecting is no longer generated.

spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.target/powerpc/pr69946.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -ffat-lto-objects -S
-o pr69946.s
PASS: gcc.target/powerpc/pr69946.c (test for excess errors)
PASS: gcc.target/powerpc/pr69946.c scan-assembler-not (?n)rlwinm.*,44,20,23
FAIL: gcc.target/powerpc/pr69946.c scan-assembler-times (?n)rlwinm.*,12,20,23 1
(found 0 times)
=== gcc Summary ===

# of expected passes2
# of unexpected failures1

<   .ident  "GCC: (GNU) 8.0.0 20171030 (experimental) [trunk revision
254212]"
---
>   .ident  "GCC: (GNU) 8.0.0 20171030 (experimental) [trunk revision 
> 254213]"

18,19c18,20
<   addis 9,2,.LC0@toc@ha   # gpr load fusion, type long
<   ld 9,.LC0@toc@l(9)
---
>   addis 10,2,.LC0@toc@ha  # gpr load fusion, type long
>   ld 10,.LC0@toc@l(10)
>   li 9,-1
22,26c23,28
<   ld 9,0(9)
<   lwz 3,0(9)
<   rlwinm 3,3,12,20,23
<   ori 3,3,0x11
<   rotldi 3,3,52
---
>   ld 10,0(10)
>   lwz 3,0(10)
>   rldicr 3,3,32,3
>   rldicl 3,3,1,2
>   rldicr 3,3,63,3
>   rldimi 3,9,52,11

[Bug c++/85125] New: constant expression with const_cast UB does not emit error

2018-03-29 Thread john at mcfarlane dot name
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125

Bug ID: 85125
   Summary: constant expression with const_cast UB does not emit
error
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: john at mcfarlane dot name
  Target Milestone: ---

Tested in godbolt.org ([example](https://godbolt.org/g/dhtXmH)) with x86-64
versions from 5.1 to 7.3 and trunk. Options are `-Wall -Wextra` but can be
reproduced without.

The following code compiles:

constexpr int f() {
  int const i = 77;
  const_cast(i) = 88;
  return i;
}
static_assert(f()==77, "");

>From reading of http://eel.is/c++draft/dcl.type.cv#4 the `const_cast` line
above results in UB and from http://eel.is/c++draft/expr.const#2.6 an
expression causing UB cannot be a constant expression.

Expected: an error is emitted on the `const_cast` line explaining that a
constant value is being written to.
Actual: code compiles without warnings or errors and the `const_cast` line
appears to be ignored. (When `constexpr` is removed, produces code for a
function that returns 77.)

[Bug fortran/52789] gfortran sets -Wunused-parameter in the C sense as well as the Fortran sense

2018-03-29 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52789

--- Comment #6 from Dominique d'Humieres  ---
With r258935 I get

% gfc pr52789.f90 -Wunused-parameter
pr52789.f90:2:23:

 integer, parameter :: i = 0
   1
Warning: Unused parameter 'i' declared at (1) [-Wunused-parameter]

% gfc pr52789.f90 -Wunused-parameter -Wunused-dummy-argument
pr52789.f90:2:23:

 integer, parameter :: i = 0
   1
Warning: Unused parameter 'i' declared at (1) [-Wunused-parameter]
pr52789.f90:1:14:

 subroutine s(x)
  1
Warning: Unused dummy argument 'x' at (1) [-Wunused-dummy-argument]

i.e. no "unused.f90:1:0: warning: unused parameter ‘x’ [-Wunused-parameter]",
gone with 6.4.0 and above.

[Bug c++/85124] New: template template parameter is printed incorrectly in the error message

2018-03-29 Thread ensadc at mailnesia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85124

Bug ID: 85124
   Summary: template template parameter is printed incorrectly in
the error message
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://wandbox.org/permlink/0ir0hnoy5jeX9KLT


template using ref = T&;

template
struct X {
template