public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60798] New: Access checking of template alias not done at the point of use
@ 2014-04-09 19:54 eric.niebler at gmail dot com
  2014-04-09 21:20 ` [Bug c++/60798] " daniel.kruegler at googlemail dot com
  2014-12-14 16:25 ` ville.voutilainen at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: eric.niebler at gmail dot com @ 2014-04-09 19:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60798

            Bug ID: 60798
           Summary: Access checking of template alias not done at the
                    point of use
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com

The following compiles with clang, but not with gcc-4.8.2

////////////////////////////////////////////
template<typename Derived>
using base_t = typename Derived::base_t;

template<typename Derived>
struct base
{
private:
  friend Derived;
  using base_t = base;
  base() {}
};

template<typename T>
struct derived : base<derived<T>>
{
  using base_t<derived>::base_t;
};

int main()
{
  derived<int> d;
}
/////////////////////////////////////////////

Result:

test.cpp: In substitution of ‘template<class Derived> using base_t = typename
Derived::base_t [with Derived = derived<int>]’:
test.cpp:16:26:   required from ‘struct derived<int>’
test.cpp:21:16:   required from here
test.cpp:9:22: error: ‘using base_t = struct base<derived<int> >’ is private
   using base_t = base;
                      ^
test.cpp:2:40: error: within this context
 using base_t = typename Derived::base_t;
>From gcc-bugs-return-448652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 09 20:04:05 2014
Return-Path: <gcc-bugs-return-448652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1319 invoked by alias); 9 Apr 2014 20:04:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1277 invoked by uid 48); 9 Apr 2014 20:04:01 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60784] Spurious -Wmissing-field-initializers warning for anonymous structure
Date: Wed, 09 Apr 2014 20:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60784-4-6zyG9FuNWz@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60784-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60784-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg00672.txt.bz2
Content-length: 601

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60784

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
It looks like this isn't about whether the struct is anonymous, we warn even on
say:
struct A { int a, b; };
struct B { struct A a; } b = { .a.a = 1, .a.b = 1 };

c.c:2:19: warning: missing initializer for field ‘b’ of ‘struct A’
[-Wmissing-field-initializers]
 struct B { struct A a; } b = { .a.a = 1, .a.b = 1 };
                   ^
c.c:1:19: note: ‘b’ declared here
 struct A { int a, b; };
                   ^
>From gcc-bugs-return-448653-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 09 20:13:36 2014
Return-Path: <gcc-bugs-return-448653-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12141 invoked by alias); 9 Apr 2014 20:13:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 12084 invoked by uid 48); 9 Apr 2014 20:13:30 -0000
From: "andi-gcc at firstfloor dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/60467] ICE with -fcilkplus
Date: Wed, 09 Apr 2014 20:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: andi-gcc at firstfloor dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60467-4-5tUhe5l8YM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60467-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60467-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg00673.txt.bz2
Content-length: 1082

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`467

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
We could add this patch to avoid the original problem:

diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
index f2179dfc..a535948 100644
--- a/gcc/c-family/cilk.c
+++ b/gcc/c-family/cilk.c
@@ -712,8 +712,9 @@ create_cilk_wrapper (tree exp, tree *args_out)
   else
     extract_free_variables (exp, &wd, ADD_READ);
   pointer_map_traverse (wd.decl_map, declare_one_free_variable, &wd);
-  wd.block = TREE_BLOCK (exp);
-  if (!wd.block)
+  if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (exp))))
+    wd.block = TREE_BLOCK (exp);
+  else
     wd.block = DECL_INITIAL (current_function_decl);


However this just causes the next ICE later

#1  0x00000000008a8e20 in gimplify_expr (expr_p=0x7ffff6d58bf8,
pre_p=0x7fffffffd5f8, post_p=0x7fffffffd130,
    gimple_test_f=0x8957a2 <is_gimple_addressable(tree)>, fallback=3) at
../../gcc/gcc/gimplify.c:8359
8359          gcc_assert (fallback & fb_mayfail);
(gdb) p fallback
$1 = 3
(gdb) p/d fb_mayfail
$2 = 4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/60798] Access checking of template alias not done at the point of use
  2014-04-09 19:54 [Bug c++/60798] New: Access checking of template alias not done at the point of use eric.niebler at gmail dot com
@ 2014-04-09 21:20 ` daniel.kruegler at googlemail dot com
  2014-12-14 16:25 ` ville.voutilainen at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-04-09 21:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60798

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Access checking within alias templates is handled by an existing core language
issue. At the moment I have no online access to the active issue list, but I
believe that was

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1554
>From gcc-bugs-return-448657-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 09 22:28:54 2014
Return-Path: <gcc-bugs-return-448657-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1354 invoked by alias); 9 Apr 2014 22:28:53 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1316 invoked by uid 48); 9 Apr 2014 22:28:48 -0000
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60800] New: -Ofast -ffast-math -march=corei7 -mtune=generic miscompiles 178.galgel in SPEC CPU 2K
Date: Wed, 09 Apr 2014 22:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hjl.tools at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc
Message-ID: <bug-60800-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg00677.txt.bz2
Content-length: 727

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`800

            Bug ID: 60800
           Summary: -Ofast -ffast-math -march=corei7 -mtune=generic
                    miscompiles 178.galgel in SPEC CPU 2K
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: areg.melikadamyan at gmail dot com

On Linux/x86-64, revision 209068  miscompiles 178.galgel in SPEC CPU 2K
with

-Ofast -ffast-math -march=corei7 -mtune=generic

9639 segmentation fault  ./galgel_peak.tunegeneric <
../../data/ref/input/galgel.in


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/60798] Access checking of template alias not done at the point of use
  2014-04-09 19:54 [Bug c++/60798] New: Access checking of template alias not done at the point of use eric.niebler at gmail dot com
  2014-04-09 21:20 ` [Bug c++/60798] " daniel.kruegler at googlemail dot com
@ 2014-12-14 16:25 ` ville.voutilainen at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-12-14 16:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60798

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-14
                 CC|                            |ville.voutilainen at gmail dot com
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.2, 4.9.1, 5.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-14 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-09 19:54 [Bug c++/60798] New: Access checking of template alias not done at the point of use eric.niebler at gmail dot com
2014-04-09 21:20 ` [Bug c++/60798] " daniel.kruegler at googlemail dot com
2014-12-14 16:25 ` ville.voutilainen at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).