This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>
- Date: Thu, 15 Sep 2016 13:06:56 +0100
- Subject: Re: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp
- Authentication-results: sourceware.org; auth=none
- References: <20160911141027.GA10024@host1.jankratochvil.net>
On 09/11/2016 03:10 PM, Jan Kratochvil wrote:
> --- a/gdb/testsuite/gdb.cp/casts.exp
> +++ b/gdb/testsuite/gdb.cp/casts.exp
> @@ -112,7 +112,7 @@ gdb_test "print reinterpret_cast<A &> (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \
>
> # Test that keyword shadowing works.
>
This comment suggests that the test actually uses decltype on purpose.
> -gdb_test "whatis decltype(5)" " = double"
> +gdb_test "whatis int_to_double(5)" " = double"
>
Seems to be exercising the FLAG_SHADOW bits:
...
{"__typeof__", TYPEOF, OP_TYPEOF, 0 },
{"__typeof", TYPEOF, OP_TYPEOF, 0 },
{"typeof", TYPEOF, OP_TYPEOF, FLAG_SHADOW },
{"__decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX },
{"decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX | FLAG_SHADOW },
...
/* This is used to associate some attributes with a token. */
enum token_flag
{
...
/* If this bit is set, the token is conditional: if there is a
symbol of the same name, then the token is a symbol; otherwise,
the token is a keyword. */
FLAG_SHADOW = 2
};
So perhaps a better fix is to move that particular test to a
separate testcase that force-compiles with -std=c++03.
Adding Tromey, who wrote the test initially.
Thanks,
Pedro Alves