public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53551] New: -Wunused-local-typedefs misses uses
@ 2012-06-01 12:23 akim.demaille at gmail dot com
  2012-06-01 12:25 ` [Bug c++/53551] " akim.demaille at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: akim.demaille at gmail dot com @ 2012-06-01 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53551
           Summary: -Wunused-local-typedefs misses uses
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: akim.demaille@gmail.com


Hi!

In the following example, the "context" struct provides types to a template
class, "structure".  The provided type is used to define a member variable. 
Yet G++ 4.8 claims:

g++-mp-4.8 -std=c++11 -Wall bar.cc
bar.cc: In function 'int main()':
bar.cc:12:21: warning: typedef 'using type = int' locally defined but not used
[-Wunused-local-typedefs]
     using type = int;
                     ^

This is:

g++-mp-4.8 (MacPorts gcc48 4.8-20120527_1) 4.8.0 20120527 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The program is:


template <typename C>
struct structure
{
  typename C::type val;
};

int
main()
{
  struct context
  {
    using type = int;
  };

  return structure<context>{42}.val;
}

Thanks!


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
@ 2012-06-01 12:25 ` akim.demaille at gmail dot com
  2012-08-24 12:08 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: akim.demaille at gmail dot com @ 2012-06-01 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Akim Demaille <akim.demaille at gmail dot com> 2012-06-01 12:24:44 UTC ---
Created attachment 27539
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27539
Test case


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
  2012-06-01 12:25 ` [Bug c++/53551] " akim.demaille at gmail dot com
@ 2012-08-24 12:08 ` paolo.carlini at oracle dot com
  2012-09-20 13:47 ` dodji at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-24 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-24 12:07:57 UTC ---
Dodji, can we do something about this?


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
  2012-06-01 12:25 ` [Bug c++/53551] " akim.demaille at gmail dot com
  2012-08-24 12:08 ` paolo.carlini at oracle dot com
@ 2012-09-20 13:47 ` dodji at gcc dot gnu.org
  2012-09-20 20:24 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-09-20 13:47 UTC (permalink / raw)
  To: gcc-bugs


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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-09-20
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-09-20 13:46:59 UTC ---
Yes, I am testing a patch for this.


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
                   ` (2 preceding siblings ...)
  2012-09-20 13:47 ` dodji at gcc dot gnu.org
@ 2012-09-20 20:24 ` dodji at gcc dot gnu.org
  2012-09-28 12:22 ` dodji at gcc dot gnu.org
  2012-09-28 12:32 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-09-20 20:24 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-09-20 20:23:35 UTC ---
A candidate patch was sent to
http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01492.html


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
                   ` (3 preceding siblings ...)
  2012-09-20 20:24 ` dodji at gcc dot gnu.org
@ 2012-09-28 12:22 ` dodji at gcc dot gnu.org
  2012-09-28 12:32 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-09-28 12:22 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-09-28 12:21:49 UTC ---
Author: dodji
Date: Fri Sep 28 12:21:33 2012
New Revision: 191828

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191828
Log:
PR c++/53551 - -Wunused-local-typedefs misses uses

We don't record the use of a typedef when it's used through a
typename.  Fixed thus.

Tested on x86_64-unknown-linux-gnu against trunk.

gcc/cp/

    * decl.c (make_typename_type): Record the use of typedefs.

gcc/testsuite/

    * g++.dg/warn/Wunused-local-typedefs-2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs-2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/53551] -Wunused-local-typedefs misses uses
  2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
                   ` (4 preceding siblings ...)
  2012-09-28 12:22 ` dodji at gcc dot gnu.org
@ 2012-09-28 12:32 ` dodji at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-09-28 12:32 UTC (permalink / raw)
  To: gcc-bugs


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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-09-28 12:32:04 UTC ---
Fixed in trunk (4.8)


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

end of thread, other threads:[~2012-09-28 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 12:23 [Bug c++/53551] New: -Wunused-local-typedefs misses uses akim.demaille at gmail dot com
2012-06-01 12:25 ` [Bug c++/53551] " akim.demaille at gmail dot com
2012-08-24 12:08 ` paolo.carlini at oracle dot com
2012-09-20 13:47 ` dodji at gcc dot gnu.org
2012-09-20 20:24 ` dodji at gcc dot gnu.org
2012-09-28 12:22 ` dodji at gcc dot gnu.org
2012-09-28 12:32 ` dodji at gcc dot gnu.org

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).