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

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