diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-12-14 20:31:22 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-12-14 20:31:22 +0000 |
commit | 993acb366ebf8a43f66669950b385710eba931cb (patch) | |
tree | a3f1edf7efd982b0735aec9f5727133cb89fece1 /gcc/cp/lex.c | |
parent | ec047df48239928a1776c10e7e5f11c76c6974a5 (diff) | |
download | gcc-993acb366ebf8a43f66669950b385710eba931cb.zip gcc-993acb366ebf8a43f66669950b385710eba931cb.tar.gz gcc-993acb366ebf8a43f66669950b385710eba931cb.tar.bz2 |
re PR c++/45330 (Suggest likely nested-name-specifiers for undeclared identifiers.)
gcc/cp/
PR c++/45330
* cp-tree.h (suggest_alternatives_for): Add location_t parameter.
* name-lookup.c (suggest_alternatives_for): Likewise. Adjust.
* lex.c (unqualified_name_lookup_error): Adjust call to it.
* semantics.c (qualified_name_lookup_error): Move to...
* error.c (qualified_name_lookup_error): ...here. Call.
suggest_alternatives_for.
gcc/testsuite/
PR c++/45330
* g++.dg/lookup/suggestions1.C: New test.
From-SVN: r167814
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 5a2ae41..b04c89f 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -452,7 +452,7 @@ unqualified_name_lookup_error (tree name) if (!objc_diagnose_private_ivar (name)) { error ("%qD was not declared in this scope", name); - suggest_alternatives_for (name); + suggest_alternatives_for (location_of (name), name); } /* Prevent repeated error messages by creating a VAR_DECL with this NAME in the innermost block scope. */ |