On Wed, Nov 5, 2014 at 1:06 PM, Kaelyn Takata <[email protected]> wrote:
> > > On Tue, Nov 4, 2014 at 4:36 PM, David Blaikie <[email protected]> wrote: > >> It's helpful to either use an enum (which always seems a bit silly) or a >> comment (more realistic, especially since you only have to comment that >> single caller in attemptRecovery) to describe what the boolean value is for >> ("/*AcceptInvalidDecl*/ true"). >> > > I've added comments for both boolean values in the call to > SemaRef.BuildDeclarationNameExpr from attemptRecovery. > >> >> What's this flag needed/used for? >> > > The flag is needed to get a valid DeclRefExpr during error recovery even > when the Decl isn't marked as valid. > Why does this need to be a flag? (what bad things happen if we always accept invalid decls?) > For example, with the full patch set, not having the flag causes the last > error of test/SemaCXX/conversion-function.cpp (at line 419) to fail to be > typo-corrected. With the flag or without this patchset: > > ~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:419:18: error: no > member named 'e' in 'PR18234::A'; did you mean simply 'e'? > bool k1 = e == A::e; // expected-error {{no member named 'e'}} > ^~~~ > e > ~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:418:8: note: 'e' > declared here > A::E e = a; // expected-note {{here}} > ^ > 4 warnings and 26 errors generated. > > With this patchset but without this flag: > > ~/llvm/tools/clang/test/SemaCXX/conversion-function.cpp:419:21: error: no > member named 'e' in 'PR18234::A' > bool k1 = e == A::e; // expected-error {{no member named 'e'}} > ~~~^ > 4 warnings and 26 errors generated. > > >> On Wed, Oct 29, 2014 at 12:49 PM, Kaelyn Takata <[email protected]> wrote: >> >>> --- >>> include/clang/Sema/Sema.h | 6 ++++-- >>> lib/Sema/SemaExpr.cpp | 15 ++++++++------- >>> lib/Sema/SemaExprCXX.cpp | 2 +- >>> 3 files changed, 13 insertions(+), 10 deletions(-) >>> >>> >>> _______________________________________________ >>> cfe-commits mailing list >>> [email protected] >>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >>> >>> >> >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
