public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using
@ 2020-05-24 10:19 shyouhei@ruby-lang.org
  2020-06-06 15:42 ` [Bug c++/95302] " anatol.pomozov at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: shyouhei@ruby-lang.org @ 2020-05-24 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95302
           Summary: function attributed to be deprecated cannot include a
                    typedef/using
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shyouhei@ruby-lang.org
  Target Milestone: ---

https://gcc.godbolt.org/z/iH643m

Is this intentional? No other compiler that I know warns this code.

% cat tmp.cc
[[deprecated(">>>GCC BUG<<<")]]
void func(void)
{
    typedef int type;
    type(var);
}
% g++-10 -v -c tmp.cc
Using built-in specs.
COLLECT_GCC=g++-10
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
10.1.0-2ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch
--disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-10-eDoCEC/gcc-10-10.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-eDoCEC/gcc-10-10.1.0/debian/tmp-gcn/usr,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (Ubuntu 10.1.0-2ubuntu1~18.04)
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus -quiet -v -imultiarch
x86_64-linux-gnu -D_GNU_SOURCE tmp.cc -quiet -dumpbase tmp.cc -mtune=generic
-march=x86-64 -auxbase tmp -version -fasynchronous-unwind-tables
-fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccz4O9iB.s
GNU C++14 (Ubuntu 10.1.0-2ubuntu1~18.04) version 10.1.0 (x86_64-linux-gnu)
        compiled by GNU C version 10.1.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/10"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/10
 /usr/include/x86_64-linux-gnu/c++/10
 /usr/include/c++/10/backward
 /usr/lib/gcc/x86_64-linux-gnu/10/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++14 (Ubuntu 10.1.0-2ubuntu1~18.04) version 10.1.0 (x86_64-linux-gnu)
        compiled by GNU C version 10.1.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 435c9a72f92ce04eba08a47828fa63c4
tmp.cc: In function 'void func()':
tmp.cc:5:13: warning: 'void func()' is deprecated: >>>GCC BUG<<<
[-Wdeprecated-declarations]
    5 |     type(var);
      |             ^
tmp.cc:2:6: note: declared here
    2 | void func(void)
      |      ^~~~
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v --64 -o tmp.o /tmp/ccz4O9iB.s
GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.30
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

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

* [Bug c++/95302] function attributed to be deprecated cannot include a typedef/using
  2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
@ 2020-06-06 15:42 ` anatol.pomozov at gmail dot com
  2020-06-29 19:37 ` rafael at espindo dot la
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: anatol.pomozov at gmail dot com @ 2020-06-06 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

Anatol <anatol.pomozov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anatol.pomozov at gmail dot com

--- Comment #1 from Anatol <anatol.pomozov at gmail dot com> ---
Shyouhei, thank you for filing this ticket.

I agree that GCC should not complain about deprecated usage if the symbol is
not really used.

Such GCC behavior causes excessive compile time warnings when using SWIG
library https://github.com/swig/swig/issues/1689#issuecomment-636109918

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

* [Bug c++/95302] function attributed to be deprecated cannot include a typedef/using
  2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
  2020-06-06 15:42 ` [Bug c++/95302] " anatol.pomozov at gmail dot com
@ 2020-06-29 19:37 ` rafael at espindo dot la
  2021-08-11 20:56 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rafael at espindo dot la @ 2020-06-29 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

Rafael Avila de Espindola <rafael at espindo dot la> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rafael at espindo dot la

--- Comment #2 from Rafael Avila de Espindola <rafael at espindo dot la> ---
The same problem happens with a namespace alias:

namespace foo {
void bar();
}
[[deprecated("zed")]] inline void zed() {
    namespace a = foo;
    a::bar();
}

Produces:

test.cc: In function ‘void zed()’:
test.cc:6:8: warning: ‘void zed()’ is deprecated: zed
[-Wdeprecated-declarations]
    6 |     a::bar();
      |        ^~~
test.cc:4:35: note: declared here
    4 | [[deprecated("zed")]] inline void zed() {
      |                                   ^~~


If instead of the alias foo::bar() is used directly, no warning is produced.

The issue is still present on current master
(346bce6fe0cf1ed5f6a7ad732d2361d77b203c87).

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

* [Bug c++/95302] function attributed to be deprecated cannot include a typedef/using
  2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
  2020-06-06 15:42 ` [Bug c++/95302] " anatol.pomozov at gmail dot com
  2020-06-29 19:37 ` rafael at espindo dot la
@ 2021-08-11 20:56 ` pinskia at gcc dot gnu.org
  2021-08-11 20:57 ` pinskia at gcc dot gnu.org
  2021-08-12  0:38 ` shyouhei@ruby-lang.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-11 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.2.0
      Known to work|                            |10.3.0, 11.1.0

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Seems fixed in GCC 10.3.0 and 11+.

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

* [Bug c++/95302] function attributed to be deprecated cannot include a typedef/using
  2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
                   ` (2 preceding siblings ...)
  2021-08-11 20:56 ` pinskia at gcc dot gnu.org
@ 2021-08-11 20:57 ` pinskia at gcc dot gnu.org
  2021-08-12  0:38 ` shyouhei@ruby-lang.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-11 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 99318.

*** This bug has been marked as a duplicate of bug 99318 ***

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

* [Bug c++/95302] function attributed to be deprecated cannot include a typedef/using
  2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
                   ` (3 preceding siblings ...)
  2021-08-11 20:57 ` pinskia at gcc dot gnu.org
@ 2021-08-12  0:38 ` shyouhei@ruby-lang.org
  4 siblings, 0 replies; 6+ messages in thread
From: shyouhei@ruby-lang.org @ 2021-08-12  0:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from URABE, Shyouhei <shyouhei@ruby-lang.org> ---
Confirmed fixed at GCC 10.3.0.  Thank you!

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

end of thread, other threads:[~2021-08-12  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24 10:19 [Bug c++/95302] New: function attributed to be deprecated cannot include a typedef/using shyouhei@ruby-lang.org
2020-06-06 15:42 ` [Bug c++/95302] " anatol.pomozov at gmail dot com
2020-06-29 19:37 ` rafael at espindo dot la
2021-08-11 20:56 ` pinskia at gcc dot gnu.org
2021-08-11 20:57 ` pinskia at gcc dot gnu.org
2021-08-12  0:38 ` shyouhei@ruby-lang.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).