This is an archive of the discontinued LLVM Phabricator instance.

Tweak the diagnostic machinery to emit a NamedDecl's type, instead of empty quotes, if it represents an unnamed TypeDecl.
Needs ReviewPublic

Authored by faisalv on Jul 26 2016, 7:47 PM.

Details

Reviewers
rsmith
Summary

Currently the following code triggers diagnostics that match:

auto L = []{ }; expected-note{{'' is not literal}}
constexpr int f(decltype(L)) { return 0; }
expected-error{{not a literal type}}

After applying this patch the diagnostics match:
auto L = []{ }; //expected-note{{'(lambda at <source-info>)' is not literal}}

As encouraged by Richard during his review of: https://reviews.llvm.org/D22662 .

Diff Detail

Event Timeline

faisalv updated this revision to Diff 65653.Jul 26 2016, 7:47 PM
faisalv retitled this revision from to Tweak the diagnostic machinery to emit a NamedDecl's type, instead of empty quotes, if it represents an unnamed TypeDecl..
faisalv updated this object.
faisalv added a reviewer: rsmith.
faisalv added a subscriber: cfe-commits.
faisalv updated this revision to Diff 65654.Jul 26 2016, 8:12 PM

Refactored the common code from each insertion operator into a single template function called: addNameDeclOrItsTypeToDiagnostic(...).