public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66472] -Wshadow gets confused by using statements in template classes
Date: Tue, 09 Jun 2015 13:11:00 -0000	[thread overview]
Message-ID: <bug-66472-4-pD29F7MQpP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66472-4@http.gcc.gnu.org/bugzilla/>

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
> As suggested there https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709#c16, I
> tried to break at the call to warning_at to give you more input, but with no
> luck, as if warning_at was not called at all. (I also tried to break at any
> *warning* symbol with same result).

Probably because you are debugging the driver instead of the compiler proper:
https://gcc.gnu.org/wiki/DebuggingGCC

Sorry, I should have mentioned that.
>From gcc-bugs-return-488483-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 09 13:15:23 2015
Return-Path: <gcc-bugs-return-488483-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 99094 invoked by alias); 9 Jun 2015 13:15:23 -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 99048 invoked by uid 48); 9 Jun 2015 13:15:19 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66472] -Wshadow gets confused by using statements in template classes
Date: Tue, 09 Jun 2015 13:15: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: 5.1.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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-66472-4-tWJ2OreXEW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66472-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66472-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: 2015-06/txt/msg00815.txt.bz2
Content-length: 599

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

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #3)
> I compile with g++ -wrapper gdb,--args ... where this gcc was compile with
> -O0 -g. Breaking on warning_at shows that member is a using_decl.

Is there anyway to tell what the using_decl is actually representing? Perhaps
via its type?

I think this is one of those cases where false negatives are more annoying than
false positives are dangerous, thus maybe the warning should be silent for all
using_decl.
>From gcc-bugs-return-488484-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 09 13:15:58 2015
Return-Path: <gcc-bugs-return-488484-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 100121 invoked by alias); 9 Jun 2015 13:15:58 -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 100062 invoked by uid 48); 9 Jun 2015 13:15:54 -0000
From: "chtz at informatik dot uni-bremen.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66472] -Wshadow gets confused by using statements in template classes
Date: Tue, 09 Jun 2015 13:15: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: 5.1.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: chtz at informatik dot uni-bremen.de
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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-66472-4-q3NI0BucVi@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66472-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66472-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: 2015-06/txt/msg00816.txt.bz2
Content-length: 760

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf472

--- Comment #6 from Christoph Hertzberg <chtz at informatik dot uni-bremen.de> ---
Ok, good point on shadowing free functions.
Next pathological example: If you have a template specialization of your Base
with a static member variable called `size`, wouldn't the warning make sense?

template <class T>
struct Base {
  Base(int y) {std::cout << "y=" <<y <<"\n";}
  T size();
};

template<class T>
struct Bar : Base<T> {
  using Base<T>::size;
  Bar(int size) : Base<T>(size) {}
  Bar() : Base<T>(size) {} // only works for T==int
};

// Specialization, probably not visible when Bar is defined:
template<>
struct Base<int> {
  Base<int>(int x) {std::cout << "x=" <<x <<"\n";}
  const static int sizeB;
};


  parent reply	other threads:[~2015-06-09 13:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09 11:25 [Bug c++/66472] New: " gael.guennebaud at gmail dot com
2015-06-09 12:39 ` [Bug c++/66472] " chtz at informatik dot uni-bremen.de
2015-06-09 12:54 ` gael.guennebaud at gmail dot com
2015-06-09 13:07 ` glisse at gcc dot gnu.org
2015-06-09 13:11 ` manu at gcc dot gnu.org [this message]
2021-12-25  1:43 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66472-4-pD29F7MQpP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).