[cfe-commits] r147962 - in /cfe/trunk: include/clang/Sema/Sema.h include/clang/Sema/TypoCorrection.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaLookup.cpp test/SemaCXX/typo-correction.cpp

Chandler Carruth chandlerc at gmail.com
Wed Jan 11 11:49:37 PST 2012


A few comments inline...

On Wed, Jan 11, 2012 at 11:37 AM, Kaelyn Uhrain <rikka at google.com> wrote:
>
> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=147962&r1=147961&r2=147962&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Jan 11 13:37:46 2012
> @@ -1745,6 +1745,30 @@
>                              EllipsisLoc);
>  }
>
> +namespace {
> +
> +// Callback to only accept typo corrections that are namespaces.
>

I think this comment was cut/pasted from the other callback.

Modified: cfe/trunk/test/SemaCXX/typo-correction.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction.cpp?rev=147962&r1=147961&r2=147962&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/SemaCXX/typo-correction.cpp (original)
> +++ cfe/trunk/test/SemaCXX/typo-correction.cpp Wed Jan 11 13:37:46 2012
> @@ -29,3 +29,14 @@
>  inline error_condition make_error_condition(errc _e) {
>   return error_condition(static_cast<int>(_e));
>  }
> +
> +
> +// Prior to the introduction of a callback object to further filter
> possible
> +// typo corrections, this example would not trigger a suggestion as
> "base_type"
> +// is a closer match to "basetype" than is "BaseType" but "base_type"
> does not
> +// refer to a base class or non-static data member.
> +struct BaseType { };
> +struct Derived : public BaseType { // expected-note {{base class
> 'BaseType' specified here}}
> +  static int base_type;
> +  Derived() : basetype() {} // expected-error{{initializer 'basetype'
> does not name a non-static data member or base class; did you mean the base
> class 'BaseType'?}}
> +};


It would be good to try to add similar examples for the other two code
paths you switched to the callback mechanism.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120111/6c5a5412/attachment.html>


More information about the cfe-commits mailing list