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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-25
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
There's a -Wunused-variable warning at least:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 78679.cc
78679.cc: In function ‘int main()’:
78679.cc:3:7: warning: unused variable ‘a’ [-Wunused-variable]
  auto a = 6 + ".txt";
       ^
$

...and once you try to do anything with 'a' to use it to silence the
-Wunused-variable warning, it quickly turns into other issues:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 78679.cc
78679.cc: In function ‘int main()’:
78679.cc:4:9: error: invalid conversion from ‘const char*’ to ‘int’
[-fpermissive]
  return a;
         ^
$

So I guess confirmed that g++ could warn earlier about the addition, too, to
prevent it from leading to further issues. Might be related to requests for a
-Wstring-plus-int, but in reverse order.

Reply via email to