[Bug c++/89429] New: ICE with __func__

2019-02-21 Thread vakevk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89429

Bug ID: 89429
   Summary: ICE with __func__
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vakevk at gmail dot com
  Target Milestone: ---

Created attachment 45782
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45782&action=edit
Example code

g++ (Debian 8.2.0-20) 8.2.0

Compiling the attached code with `g++ testcase.cpp` results in an internal
compiler error:

main.cpp: In instantiation of 'g() [with T = int]:: [with
auto:1 = int]':
main.cpp:4:13:   required from 'void f(Function&&) [with Function = g() [with T
= int]::]'
main.cpp:11:6:   required from 'void g() [with T = int]'
main.cpp:18:12:   required from here
main.cpp:12:9: internal compiler error: in enclosing_instantiation_of, at
cp/pt.c:13321
 __func__;
 ^~~~
0x7f5b303dc09a __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/89429] ICE with __func__

2019-02-21 Thread vakevk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89429

--- Comment #1 from Valentin  ---
Sorry, this was the wrong attachment.

The proper code is:


template 
void f(Function&& function) {
// `0` is not special. Can be any value of any type.
function(0);
}

// No error when this template parameter is removed.
template
void g() {
// Must be `auto`.
f([](auto) {
__func__;
});
}

void h() {
// `int` is not special. Can be any type. 
g();
}

[Bug c++/89429] ICE with __func__

2019-02-21 Thread vakevk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89429

--- Comment #2 from Valentin  ---
Comment on attachment 45782
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45782
Example code

template 
void f(Function&& function) {
// `0` is not special. Can be any value of any type.
function(0);
}

// No error when this template parameter is removed.
template
void g() {
// Must be `auto`.
f([](auto) {
__func__;
});
}

void h() {
// `int` is not special. Can be any type. 
g();
}

[Bug sanitizer/87095] New: UndefinedBehaviorSanitizer vptr false positive with virtual inheritance only with -fno-sanitize-recover

2018-08-24 Thread vakevk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87095

Bug ID: 87095
   Summary: UndefinedBehaviorSanitizer vptr false positive with
virtual inheritance only with -fno-sanitize-recover
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vakevk at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Created attachment 44591
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44591&action=edit
main.cpp

Program does not run successfully when compiled with:
g++ -fsanitize=vptr -fno-sanitize-recover=vptr main.cpp

main.cpp:9:8: runtime error: member call on address 0x7ffd7987dc20 which does
not point to an object of type 'A'
0x7ffd7987dc20: note: object has invalid vptr
 c1 55 00 00  00 00 00 00 00 00 00 00  00 b0 34 7e ca 6d 56 eb  20 dd 87 79 fd
7f 00 00  00 00 00 00
   ^~~
 invalid vptr



Program runs successfully if -fno-sanitize-recover=vptr is not specified or
when compiled with clang++ (6.0.1-5) with the original options.

Even without knowing whether the error message is correct, there is bug here
because the message should be shown consistently regardless of the recovery
option.

g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --enable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
--enable-cet=auto
Thread model: posix
gcc version 8.2.0 (GCC)