Bug 52959 - Missing typo suggestions
Summary: Missing typo suggestions
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2012-04-12 22:05 UTC by davidxl
Modified: 2021-08-10 10:10 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-08-09 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davidxl 2012-04-12 22:05:34 UTC
struct BaseType {};
struct DerivedType : public BaseType {
 static int base_type;
 DerivedType() : basetype() {}
};


/*

typo1.cpp:4:19: error: initializer 'basetype' does not name a non-static
data member or base class; did you mean the base class 'BaseType'?
 DerivedType() : basetype() {}
                 ^~~~~~~~
                 BaseType
typo1.cpp:2:22: note: base class 'BaseType' specified here
struct DerivedType : public BaseType {
                    ^~~~~~~~~~~~~~~
1 error generated.

*/


namespace fiz { namespace bang {
  int foobar();
 } }
 int test() {
  return bang::Foobar();
 }

/*

typo2.cpp:5:10: error: use of undeclared identifier 'bang'; did you mean
'fiz::bang'?
 return bang::Foobar();
        ^~~~
        fiz::bang
typo2.cpp:1:27: note: 'fiz::bang' declared here
namespace fiz { namespace bang {
                         ^
typo2.cpp:5:16: error: no member named 'Foobar' in namespace 'fiz::bang';
did you mean 'foobar'?
 return bang::Foobar();
        ~~~~~~^~~~~~
              foobar
typo2.cpp:2:7: note: 'foobar' declared here
 int foobar();
     ^
2 errors generated.

*/
Comment 1 Andrew Pinski 2012-04-12 22:51:47 UTC
I think this is the same as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52277 .
Comment 2 Manuel López-Ibáñez 2012-04-12 23:02:47 UTC
(In reply to comment #1)
> I think this is the same as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52277 .

No, this is a bit more complex than a simple spell-checker.

(Although the bang::foobar is probably easy to implement).
Comment 3 Manuel López-Ibáñez 2014-08-20 23:35:23 UTC
I for one would love to have this (and PR52277) but I cannot commit the amount of time/work needed to make this work.

Pretty please, could someone implement it? Marek, Paolo, Google guys?
Comment 4 Jonathan Wakely 2021-08-10 10:10:48 UTC
This is a rather unhelpful bug report. For anybody else wondering what the OP is actually saying: the commented-out errors in the original report show clang's output, and the request is that GCC should do something similar.