https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70693
Bug ID: 70693
Summary: valgrind error in get_visual_column
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Created attachment 38289
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38289&action=edit
C++ source code
The attached C++ code, when compiled by gcc trunk dated 20160412, does this:
==12372== Invalid read of size 1
==12372== at 0x73E3EF: get_visual_column(expanded_location, unsigned int,
unsigned int*, unsigned int*) [clone .isra.1] (c-indentation.c:81)
==12372== by 0x73E5A5: should_warn_for_misleading_indentation
(c-indentation.c:397)
==12372== by 0x73E5A5: warn_for_misleading_indentation(token_indent_info
const&, token_indent_info const&, token_indent_info const&)
(c-indentation.c:601)
==12372== by 0x6797B3: cp_parser_implicitly_scoped_statement(cp_parser*,
bool*, token_indent_info const&, vec<tree_node*, va_heap, vl_ptr>*)
(parser.c:11928)
$ ~/gcc/results/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dcb/gcc/results/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb/gcc/results/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../src/trunk/configure --prefix=/home/dcb/gcc/results
--disable-bootstrap --disable-multilib --disable-werror
--enable-checking=valgrind --enable-languages=c,c++,fortran
Thread model: posix
gcc version 6.0.0 20160412 (experimental) (GCC)
$
Command line for the compiler is
$ ~/gcc/results/bin/gcc -c -Wmisleading-indentation bug277.cc