[Bug c++/90515] New: g++ ignores [[deprecated("text")]] in some template specialisations

2019-05-16 Thread p.cross13 at yahoo dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90515

Bug ID: 90515
   Summary: g++ ignores [[deprecated("text")]] in some template
specialisations
   Product: gcc
   Version: 9.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: p.cross13 at yahoo dot com
  Target Milestone: ---

#include 

// the deprecated attribute is ignored by the compiler for the BAD template. It
works for GOOD.

template  struct GOOD   {static constexpr 
int value=1012;};
template <>   struct [[deprecated("GOODT")]] GOOD {static constexpr
int value=1099;};
template <>   struct GOOD{static constexpr
int value=1000;};

template  structBAD  {static
constexpr int value=i;};
template struct [[deprecated("BADT")]] BAD {static
constexpr int value=100+i;};
template structBAD{static
constexpr int value=-100+i;};


int main () {

std::cout<<"GOODCLASS "<::value  <<':'<::value 
<  goodt;
GOOD goodf;

std::cout<<"GOODOBJECT "<::value<<':'<::value
<  badt4;
BAD badf8;

std::cout<<"BADOBJECT "<g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=D:/mingw9.1MCF/bin/../lib/gcc/x86_64-w64-mingw32/9.1.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=nocona --enable-languages=c,lto,c++ --enable-shared --enable-static
--enable-threads=mcf --enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug
--enable-libstdcxx-filesystem-ts=yes --disable-isl-version-check --enable-lto
--enable-libgomp --disable-multilib --enable-checking=release --disable-rpath
--disable-win32-registry --enable-nls --disable-werror --disable-symvers
--with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64
--with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='gcc-9-branch HEAD
with MCF thread model, built by LH_Mouse.'
--with-bugurl=https://gcc-mcf.lhmouse.com/ --with-gnu-as --with-gnu-ld
--disable-tls --enable-plugin
Thread model: mcf
gcc version 9.1.1 20190506 (gcc-9-branch HEAD with MCF thread model, built by
LH_Mouse.)

D:\>g++ -std=c++2a -Wall -Wextra deprecatedError.cpp
deprecatedError.cpp: In function 'int main()':
deprecatedError.cpp:18:14: warning: 'GOOD' is deprecated: GOODT
[-Wdeprecated-declarations]
   18 |  GOOD  goodt;
  |  ^
deprecatedError.cpp:6:50: note: declared here
6 | template <>   struct [[deprecated("GOODT")]] GOOD {static
constexpr int value=1099;};
  |  ^~

D:\>a
GOODCLASS 1099:1000
GOODOBJECT 1099:1000

BADCLASS 104:-92
BADOBJECT 104:-92


D:\>


Same result for 
$ g++ -v
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-8.3.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=ada,c,lto,c++,objc,obj-c++,fortran
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64
--with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64
--with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld
Thread model: posix
gcc version 8.3.0 (Rev2, Built by MSYS2 project)

peter@DESKTOP-U70S6AV MSYS /d
$

*/

[Bug c++/101224] New: Problem with interaction of modules and std::unique_ptr

2021-06-26 Thread p.cross13 at yahoo dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101224

Bug ID: 101224
   Summary: Problem with interaction of modules and
std::unique_ptr
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: p.cross13 at yahoo dot com
  Target Milestone: ---

Created attachment 51063
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51063&action=edit
main program file with two module files included in comments, plus compiler
output and compiler version in comments

Code that compiles without modules, and uses std::unique_ptr, has a problem
when parts of the code are moved to modules

$ /d/gcc11/bin/g++ -std=c++20 -fmodules-ts  FmtMain.cpp
In file included from d:\gcc11\include\c++\11.1.0\memory:76,
 from FmtMain.cpp:1:
d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h: In instantiation of 'void
std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Fmt1@Fmt1]':
d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h:361:17:   required from
'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Fmt1@Fmt1; _Dp =
std::default_delete]'
FmtMain.cpp:24:24:   required from here
d:\gcc11\include\c++\11.1.0\bits\unique_ptr.h:85:9: error: array subscript is
not an integer
   85 | delete __ptr;
  | ^~~~