Offer

2025-02-07 Thread Farhan Faruqui
Hello, Should I continue using this email address to contact you? Farhan Faruqui

[pushed: r15-5739] c-family: offer suggestions for missing command-line options [PR82892]

2024-11-27 Thread David Malcolm
Some builtin macros are only defined when certain command-line options are provided. Update the error messages for them so that we suggest the pertinent option ('-fopenacc' for '_OPENACC', and '-fopenmp' for '_OPENMP') Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk

[PATCH 2/7] C++: don't offer bogus "._0" suggestions (PR c++/86329)

2019-02-14 Thread David Malcolm
PR c++/86329 reports that the C++ frontend can offer bogus suggestions like: #include int compare() { return __n1 - __n2; } suggested.cc: In function 'int compare()': suggested.cc:5:10: error: '__n1' was not declared in this scope return __n1 - __n2;

[PATCH 1/7] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2019-02-14 Thread David Malcolm
gcc/cp/ChangeLog: Backport of r259720 from trunk. 2018-04-27 David Malcolm PR c++/85515 * name-lookup.c (consider_binding_level): Skip compiler-generated variables. * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Flatten nested i

Re: [PATCH] C++: don't offer bogus "._0" suggestions (PR c++/86329)

2018-06-27 Thread Jason Merrill
OK. On Wed, Jun 27, 2018 at 3:01 PM, David Malcolm wrote: > PR c++/86329 reports that the C++ frontend can offer bogus suggestions like: > > #include > > int compare() > { > return __n1 - __n2; > } > > suggested.cc: In function 'int compare()': &g

[PATCH] C++: don't offer bogus "._0" suggestions (PR c++/86329)

2018-06-27 Thread David Malcolm
PR c++/86329 reports that the C++ frontend can offer bogus suggestions like: #include int compare() { return __n1 - __n2; } suggested.cc: In function 'int compare()': suggested.cc:5:10: error: '__n1' was not declared in this scope return __n1 - __n2; ^~~~ sug

Re: [PATCH] v2: Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-27 Thread Jason Merrill
On Thu, Apr 26, 2018 at 8:09 PM, David Malcolm wrote: > On Thu, 2018-04-26 at 15:53 -0400, Jason Merrill wrote: >> On Thu, Apr 26, 2018 at 3:45 AM, Richard Biener >> wrote: >> > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell >> > wrote: >> > > On 04/25/2018 11:41 AM, David Malcolm wrote: >> > >

[PATCH] v2: Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-26 Thread David Malcolm
On Thu, 2018-04-26 at 15:53 -0400, Jason Merrill wrote: > On Thu, Apr 26, 2018 at 3:45 AM, Richard Biener > wrote: > > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell > > wrote: > > > On 04/25/2018 11:41 AM, David Malcolm wrote: > > > > > > > > Jason Turner's video C++ Weekly - Ep 112 - GCC's Le

Re: [PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-26 Thread Jason Merrill
On Thu, Apr 26, 2018 at 3:45 AM, Richard Biener wrote: > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell wrote: >> On 04/25/2018 11:41 AM, David Malcolm wrote: >>> >>> Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky Abstractions shows >>> two issues where g++ offers suggestions about imple

Re: [PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-26 Thread Richard Biener
On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell wrote: > On 04/25/2018 11:41 AM, David Malcolm wrote: >> >> Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky Abstractions shows >> two issues where g++ offers suggestions about implementation details: > > >> For the lambda capture case, there a

Re: [PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-25 Thread Nathan Sidwell
On 04/25/2018 11:41 AM, David Malcolm wrote: Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky Abstractions shows two issues where g++ offers suggestions about implementation details: For the lambda capture case, there are multiple members: $9 = These names have a space at the end, so

Re: [PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-25 Thread Jakub Jelinek
On Wed, Apr 25, 2018 at 11:41:51AM -0400, David Malcolm wrote: > @@ -1224,9 +1225,19 @@ lookup_field_fuzzy_info::fuzzy_lookup_field (tree type) > >for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) > { > - if (!m_want_type_p || DECL_DECLARES_TYPE_P (field)) > -

[PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-25 Thread David Malcolm
Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky Abstractions shows two issues where g++ offers suggestions about implementation details: Example 1: int main () { auto lambda = [val = 2](){}; lambda.val; } : In function 'int main()': :5:10: error: 'struct main()::' has no member named

Re: [PATCH v2] Offer suggestions for unrecognized sanitizer options (PR driver/78877)

2017-01-11 Thread Jakub Jelinek
On Tue, Jan 10, 2017 at 08:47:26PM -0500, David Malcolm wrote: > + /* For -fsanitize-recover= (and not -fno-sanitize-recover=), > + don't offer the non-recoverable options. */ > + if (!sanitizer_opts[i].can_recover && code == OPT_fsanitize_recover_ >

[PATCH v2] Offer suggestions for unrecognized sanitizer options (PR driver/78877)

2017-01-10 Thread David Malcolm
onditions you suggest (and new test cases for them). Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: PR driver/78877 * opts.c: Include "spellcheck.h" (struct string_fragment): New struct. (struct edit_distance_traits)

Re: [PATCH] Offer suggestions for unrecognized sanitizer options (PR driver/78877)

2017-01-10 Thread Jakub Jelinek
On Tue, Jan 10, 2017 at 03:02:49PM -0500, David Malcolm wrote: > +/* Given ARG, an unrecognized sanitizer option, return the best > + matching sanitizer option, or NULL if there isn't one. */ > + > +static const char * > +get_closest_sanitizer_option (const string_fragment &arg) > +{ > + best_m

[PATCH] Offer suggestions for unrecognized sanitizer options (PR driver/78877)

2017-01-10 Thread David Malcolm
PR driver/78877 notes that we offer a suggestion for "-fsanitize-addres" (with a hyphen): xgcc: error: unrecognized command line option '-fsanitize-addres'; did you mean '-fsanitize=address'? but not for "-fsanitize=addres" (with an equals sign):

Re: [PATCH] Offer suggestions for misspelled attributes (PR c/70186)

2016-12-19 Thread Jakub Jelinek
Hi! On Mon, Dec 19, 2016 at 11:51:29AM -0500, David Malcolm wrote: > +/* Look for near matches for the scoped attribute with namespace NS and > + name NAME. > + Return the best matching attribute name, or NULL if none is found. > + If it returns non-NULL then *UNDERSCORES is written to, with

[PATCH] Offer suggestions for misspelled attributes (PR c/70186)

2016-12-19 Thread David Malcolm
o.. (warn_about_unidentified_attribute): ...this new function, and potentially offer suggestions for misspelled attributes. gcc/testsuite/ChangeLog: PR c/70186 * c-c++-common/spellcheck-attributes.c: New test case. * g++.dg/cpp0

Re: [PATCH] spellcheck bugfixes: don't offer the goal string as a suggestion

2016-11-28 Thread Jeff Law
ffering it as a suggestion will always be nonsensical e.g. 'constexpr' does not name a type; did you mean 'constexpr'? Ultimately such suggestions are due to bugs in constructing the candidate list. As a band-aid, the patch updates best_match::get_best_meaningful_candid

[PATCH] spellcheck bugfixes: don't offer the goal string as a suggestion

2016-11-15 Thread David Malcolm
nsical e.g. 'constexpr' does not name a type; did you mean 'constexpr'? Ultimately such suggestions are due to bugs in constructing the candidate list. As a band-aid, the patch updates best_match::get_best_meaningful_candidate so that we no longer offer suggestions for th

Re: [PATCH] Offer suggestions for misspelled --param names.

2016-06-29 Thread Joseph Myers
On Mon, 27 Jun 2016, David Malcolm wrote: > Another use of spellcheck.{c|h}, this time for --param. > > Successfully bootstrapped®retested on x86_64-pc-linux-gnu; > adds 4 PASS results to gcc.sum. > > OK for trunk? OK. -- Joseph S. Myers jos...@codesourcery.com

[PATCH] Offer suggestions for misspelled --param names.

2016-06-27 Thread David Malcolm
Another use of spellcheck.{c|h}, this time for --param. Successfully bootstrapped®retested on x86_64-pc-linux-gnu; adds 4 PASS results to gcc.sum. OK for trunk? gcc/ChangeLog: * opts.c (handle_param): Use find_param_fuzzy to offer suggestions for misspelled param names

Re: [PATCH] C++ FE: offer suggestions for misspelled field names

2015-11-19 Thread Jason Merrill
OK, thanks. Jason

Re: [PATCH] C++ FE: offer suggestions for misspelled field names

2015-11-13 Thread David Malcolm
asses bootstrap®rtest? Oops; it didn't. Sorry. Updated patch attached; this one does pass bootstrap®rtest. OK for trunk? >From fdf5026e324e00d66774c9f581840120061d4e39 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 13 Nov 2015 15:30:18 -0500 Subject: [PATCH] C++ FE: offer su

[PATCH] C++ FE: offer suggestions for misspelled field names

2015-11-13 Thread David Malcolm
fuzzy_info::fuzzy_lookup_fnfields): New. (lookup_field_fuzzy_info::fuzzy_lookup_field): New. (lookup_field_fuzzy_r): New. (lookup_member_fuzzy): New. * typeck.c (finish_class_member_access_expr): When issuing a "has no member named" error, call lookup_member_fuzzy, a