[cfe-commits] PATCH: Add support for C++ namespace-aware typo correcting

Kaelyn Uhrain rikka at google.com
Thu Jun 23 17:11:58 PDT 2011


>
> +    // FIXME: Don't do the lookups if argument dependent lookup is
> required as
> +    // this will break
> test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
>
> Is this FIXME still relevant, given that we're doing the appropriate
> requiresADL check?
>

I've found a problem with the simple ADL check in CorrectTypo... with it,
common cases we want to suggest corrections for such as:

namespace fizbin {
  namespace nested { bool moreFoobar() { return true; } }
}
void foo() {
  moreFoobar();
}

give:

tmp.cpp:5:3: error: use of undeclared identifier 'moreFoobar'
  moreFoobar();
  ^
1 error generated.

instead of:

tmp.cpp:5:3: error: use of undeclared identifier 'moreFoobar'; did you mean
      'fizbin::nested::moreFoobar'?
  moreFoobar();
  ^~~~~~~~~~
  fizbin::nested::moreFoobar
tmp.cpp:2:27: note: 'fizbin::nested::moreFoobar' declared here
  namespace nested { bool moreFoobar() { return true; } }

but without the check, basic.lookup.argdep/p4.cpp reports:

error: 'error' diagnostics seen but not expected:
  Line 35: no viable conversion from 'B::B' to 'C::C'
error: 'note' diagnostics seen but not expected:
  Line 23: 'C::func' declared here
  Line 22: candidate constructor (the implicit copy constructor) not viable:
no known conversion from 'B::B' to 'const C::C &' for 1st argument
  Line 23: passing argument to parameter here
4 errors generated.

Ideas?

- Kaelyn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110623/6a1a4a68/attachment.html>


More information about the cfe-commits mailing list