public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39560]  New: Erroneous wanings 'unused variable' in a templetated class method with union
@ 2009-03-26  4:43 yuri at tsoft dot com
  2009-04-16 21:05 ` [Bug c++/39560] [4.3/4.4/4.5 Regression] Erroneous warnings 'unused variable' in a templated " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: yuri at tsoft dot com @ 2009-03-26  4:43 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

This testcase has warnings:
--- begin testcase ---
struct X { };

class Z {
public:
  X* cc(int c);
};

class F {
public:
  typedef X* (Z::*MethO)(int);
  typedef X* (F::*MethF)(int);
  template<MethO m>
  X* xwrapper(int i) {
    union {
      Z *z;
      F *f;
    };
    f = this;
    return ((z->*m)(i));
  }
};

F::MethF meth = &F::xwrapper<&Z::cc>;
--- end testcase ---
warnings:
c.C: In member function ‘X* F::xwrapper(int) [with X* (Z::* m)(int) = &Z::cc]’:
c.C:23:   instantiated from here
c.C:17: warning: unused variable ‘z’
c.C:17: warning: unused variable ‘f’


-- 
           Summary: Erroneous wanings 'unused variable' in a templetated
                    class method with union
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com


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


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

end of thread, other threads:[~2009-11-12 23:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-26  4:43 [Bug c++/39560] New: Erroneous wanings 'unused variable' in a templetated class method with union yuri at tsoft dot com
2009-04-16 21:05 ` [Bug c++/39560] [4.3/4.4/4.5 Regression] Erroneous warnings 'unused variable' in a templated " pinskia at gcc dot gnu dot org
2009-04-22 13:30 ` rguenth at gcc dot gnu dot org
2009-08-04 12:48 ` rguenth at gcc dot gnu dot org
2009-11-12 23:02 ` jason at gcc dot gnu dot org
2009-11-12 23:22 ` jason at gcc dot gnu dot org
2009-11-12 23:26 ` jason at gcc dot gnu dot org
2009-11-12 23:27 ` jason at gcc dot gnu dot 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).