binutils-gdb/gdb/testsuite/gdb.cp
Tom Tromey 805e1f1908 fix PR c++/16117
This patch fixes PR c++/16117.

gdb has an extension so that users can use expressions like FILE::NAME
to choose a variable of the given name from the given file.  The bug
is that this extension takes precedence over ordinary C++ expressions
of the same form.  You might think this is merely hypothetical, but
now that C++ headers commonly do not use an extension, it is more
common.

This patch fixes the bug by making two related changes.  First, it
changes gdb to prefer the ordinary C++ meaning of a symbol over the
extended meaning.  Second, it arranges for single-quoting of the
symbol to indicate a preference for the extension.

Built and regtested on x86-64 Fedora 18.
New test case included.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	PR c++/16117:
	* c-exp.y (lex_one_token): Add "is_quoted_name" argument.
	(classify_name): Likewise.  Prefer a field of "this" over a
	filename.
	(classify_inner_name, yylex): Update.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Variables): Note gdb rules for ambiguous cases.
	Add example.

2013-11-15  Tom Tromey  <tromey@redhat.com>

	* gdb.cp/includefile: New file.
	* gdb.cp/filename.exp: New file.
	* gdb.cp/filename.cc: New file.
2013-11-15 08:43:14 -07:00
..
Makefile.in
abstract-origin.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
abstract-origin.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ambiguous.cc
ambiguous.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
annota2.cc
annota2.exp gdb/testsuite/gdb.cp/annota2.exp: Add missing empty line 2013-06-07 08:51:42 +00:00
annota3.cc
annota3.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
anon-ns.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
anon-ns.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
anon-struct.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
anon-struct.exp gdb/testsuite/gdb.cp: Fix tests for ARM C++ ABI. 2013-06-07 08:47:09 +00:00
anon-union.cc
anon-union.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arg-reference.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arg-reference.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
baseenum.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
baseenum.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bool.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bool.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
breakpoint.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
breakpoint.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bs15503.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
bs15503.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
call-c-1.c Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
call-c.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
call-c.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
casts.cc
casts.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
class2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
class2.exp PR c++/15401: 2013-05-22 20:51:49 +00:00
classes.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
classes.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cmpd-minsyms.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cmpd-minsyms.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
converts.cc * gdb.cp/converts.cc (main): Initialize 'a'. 2013-01-23 20:34:22 +00:00
converts.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cp-relocate.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cp-relocate.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cpcompletion.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cpexprs.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cpexprs.exp PR exp/15109: 2013-03-21 15:19:33 +00:00
cplabel.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cplabel.exp 2013-04-04 Sandra Loosemore <sandra@codesourcery.com> 2013-04-04 21:01:40 +00:00
cplusfuncs.cc
cplusfuncs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ctti.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
cttiadd.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
cttiadd3.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
debug-expr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
demangle.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
derivation.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
derivation.exp gdb.cp/derivation.exp: s/perrro/perror/ 2013-11-02 00:06:13 +00:00
derivation2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
destrprint.cc
destrprint.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dispcxx.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dispcxx.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
exception.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
exception.exp PR c++/12824: 2013-04-15 17:27:44 +00:00
exceptprint.cc PR c++/15176: 2013-04-15 18:09:02 +00:00
exceptprint.exp PR c++/13588: 2013-04-15 18:13:01 +00:00
expand-psymtabs-cxx.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
expand-psymtabs-cxx.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
expand-sals.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
expand-sals.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
extern-c.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
extern-c.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
filename.cc fix PR c++/16117 2013-11-15 08:43:14 -07:00
filename.exp fix PR c++/16117 2013-11-15 08:43:14 -07:00
formatted-ref.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
formatted-ref.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fpointer.cc
fpointer.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb1355.cc
gdb1355.exp Remove superfluous semicolons from testsuite throughout. 2013-06-07 17:31:09 +00:00
gdb2384-base.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384-base.h Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2384.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gdb2495.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
gdb2495.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
hang.H
hang.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
hang1.cc
hang2.cc
hang3.cc
includefile fix PR c++/16117 2013-11-15 08:43:14 -07:00
infcall-dlopen-lib.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
infcall-dlopen.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
infcall-dlopen.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
inherit.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
koenig.cc
koenig.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
local.cc
local.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
m-data.cc
m-data.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
m-static.cc PR c++/9197: 2013-03-25 17:26:18 +00:00
m-static.exp Print nonexisting/optimized out static fields gracefully. 2013-10-25 14:03:01 +00:00
m-static.h
m-static1.cc
maint.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mb-ctor.cc
mb-ctor.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mb-inline.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mb-inline.h Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-inline1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-inline2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
mb-templates.cc
mb-templates.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
member-name.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
member-name.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
member-ptr.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
member-ptr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
meth-typedefs.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
meth-typedefs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
method.cc
method.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
method2.cc
method2.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
minsym-fallback-main.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
minsym-fallback.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
minsym-fallback.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
minsym-fallback.h Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
misc.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
misc.exp Remove superfluous semicolons from testsuite throughout. 2013-06-07 17:31:09 +00:00
namespace-enum-main.cc
namespace-enum.cc
namespace-enum.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
namespace-nested-import.cc
namespace-nested-import.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
namespace.cc
namespace.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
namespace1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
nextoverthrow.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
nextoverthrow.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
no-dmgl-verbose.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
no-dmgl-verbose.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
noparam.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
noparam.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nsalias.cc PR c++/7539 2013-11-13 12:33:34 -08:00
nsalias.exp PR c++/7539 2013-11-13 12:33:34 -08:00
nsdecl.cc
nsdecl.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
nsimport.cc
nsimport.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nsnested.cc
nsnested.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nsnoimports.cc
nsnoimports.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nsrecurs.cc
nsrecurs.exp PR c++/7539 2013-11-13 12:33:34 -08:00
nsstress.cc
nsstress.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nsusing.cc
nsusing.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
operator.cc
operator.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
oranking.cc
oranking.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
overload-const.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
overload-const.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
overload.cc PR c++/15116: 2013-03-15 17:10:45 +00:00
overload.exp PR c++/15116: 2013-03-15 17:10:45 +00:00
ovldbreak.cc
ovldbreak.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ovsrch.exp 2013-04-02 Sandra Loosemore <sandra@codesourcery.com> 2013-04-03 01:40:19 +00:00
ovsrch.h Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ovsrch1.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ovsrch2.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ovsrch3.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ovsrch4.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
paren-type.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
paren-type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
parse-lang.cc gdb/ 2013-01-13 18:57:01 +00:00
parse-lang.exp gdb/ 2013-01-13 18:57:01 +00:00
pass-by-ref.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pass-by-ref.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr-574.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
pr-574.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr-1023.cc
pr-1023.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr-1210.cc
pr-1210.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr9067.cc
pr9067.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr9167.cc
pr9167.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr9594.cc
pr9631.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
pr9631.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr10687.cc
pr10687.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr10728-x.cc
pr10728-x.h
pr10728-y.cc
pr10728.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
pr12028.cc
pr12028.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
printmethod.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
printmethod.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
psmang.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
psmang1.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psmang2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psymtab-parameter.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
psymtab-parameter.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype-cv-cp.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype-cv-cp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype-flags.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ptype-flags.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
punctuator.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
re-set-overloaded.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
re-set-overloaded.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
readnow-language.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
readnow-language.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref-params.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ref-params.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref-types.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
ref-types.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rtti.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rtti.h Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rtti1.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rtti2.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
shadow.cc
shadow.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
smartp.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
smartp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
static-method.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
static-method.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
static-print-quit.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
static-print-quit.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
temargs.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
temargs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
templates.cc
templates.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
try_catch.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
try_catch.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
typedef-operator.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
typedef-operator.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
typeid.cc PR c++/9065: 2013-04-15 17:36:14 +00:00
typeid.exp PR c++/9065: 2013-04-15 17:36:14 +00:00
userdef.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
userdef.exp Fix ptype bug actually exercised in userdef.exp 2013-02-14 12:43:46 +00:00
using-crash.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
using-crash.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
virtbase.cc
virtbase.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
virtfunc.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
virtfunc.exp * gdb.cp/virtfunc.exp (make_one_vtable_result): Handle extra output 2013-06-05 20:38:37 +00:00
virtfunc2.cc Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
virtfunc2.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00