public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57183] New: [C++11]auto and -Wunused-variable
@ 2013-05-06  6:41 frankhb1989 at gmail dot com
  2013-05-06  8:37 ` [Bug c++/57183] [C++11] auto " paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: frankhb1989 at gmail dot com @ 2013-05-06  6:41 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57183
           Summary: [C++11]auto and -Wunused-variable
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: frankhb1989@gmail.com


Case:
constexpr float PI_0 = 3.1415926F;
constexpr auto PI_1 = 3.1415926F;
const float PI_2 = 3.1415926F;
const auto PI_3 = 3.1415926F;

int main(){}


Using gcc version 4.8.0 (rev2, Built by MinGW-builds project).

g++ a.cc -std=c++11 -Wall
a.cc:2:16: warning: 'PI_1' defined but not used [-Wunused-variable]
 constexpr auto PI_1 = 3.1415926F;
                ^
a.cc:4:12: warning: 'PI_3' defined but not used [-Wunused-variable]
 const auto PI_3 = 3.1415926F;
            ^

The difference between auto and non-auto declarations seems to be not intended.


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

end of thread, other threads:[~2013-06-06 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-06  6:41 [Bug c++/57183] New: [C++11]auto and -Wunused-variable frankhb1989 at gmail dot com
2013-05-06  8:37 ` [Bug c++/57183] [C++11] auto " paolo.carlini at oracle dot com
2013-05-06  8:47 ` paolo.carlini at oracle dot com
2013-05-06 17:03 ` paolo.carlini at oracle dot com
2013-06-06 22:59 ` paolo.carlini at oracle 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).