This revision was automatically updated to reflect the committed changes.
Closed by commit rL348239: [WIP][Sema] Improve static_assert diagnostics for
type traits. (authored by courbet, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
htt
courbet added a comment.
Thank you both for the review !
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.l
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
Comment at: lib/Sema/SemaTemplate.cpp:3055
+// Print a diagnostic for the failing static_assert expression. Defaults to
+// pretty-printing the expressi
courbet marked an inline comment as done.
courbet added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3055
+// Print a diagnostic for the failing static_assert expression. Defaults to
+// pretty-printing the expression.
aaron.ballman wrote:
> courbet w
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3055
+// Print a diagnostic for the failing static_assert expression. Defaults to
+// pretty-printing the expression.
courbet wrote:
> aaron.ballman wrote:
> > Comment is a bit out of da
courbet marked an inline comment as done.
courbet added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3055
+// Print a diagnostic for the failing static_assert expression. Defaults to
+// pretty-printing the expression.
aaron.ballman wrote:
> Comment i
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3055
+// Print a diagnostic for the failing static_assert expression. Defaults to
+// pretty-printing the expression.
Comment is a bit out of date as this is no longer specific to `stati
courbet updated this revision to Diff 176320.
courbet added a comment.
- Fix spurious formating changes
- Add tests
- Improve readability.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
include/clang/AST/NestedN
courbet marked 4 inline comments as done.
courbet added inline comments.
Comment at: lib/AST/NestedNameSpecifier.cpp:308-310
+if (ResolveTemplateArguments && getAsRecordDecl()) {
+ if (const auto *Record =
+ dyn_cast(getAsRecordDecl())) {
aa
aaron.ballman added inline comments.
Comment at: include/clang/AST/NestedNameSpecifier.h:220
+ void print(raw_ostream &OS, const PrintingPolicy &Policy,
+ bool ResolveTemplateArguments = false) const;
Quuxplusone wrote:
> Peanut gallery says: Shoul
Quuxplusone added a comment.
Looks fine to me; please don't let //me// block this any further. :) Someone
else, e.g. @aaron.ballman, should be the one to accept it, though.
Comment at: include/clang/AST/NestedNameSpecifier.h:220
+ void print(raw_ostream &OS, const PrintingPol
aaron.ballman added inline comments.
Comment at: lib/AST/NestedNameSpecifier.cpp:308-310
+if (ResolveTemplateArguments && getAsRecordDecl()) {
+ if (const auto *Record =
+ dyn_cast(getAsRecordDecl())) {
I'd remove the `getAsRecordDecl()` fro
courbet added a comment.
Thanks
Comment at: lib/Sema/SemaTemplate.cpp:3064
+// If this is a qualified name, expand the template arguments in nested
+// qualifiers.
+DR->getQualifier()->print(OS, PrintPolicy, true);
Quuxplusone wrote:
> I don't under
courbet updated this revision to Diff 175855.
courbet marked 5 inline comments as done.
courbet added a comment.
- add more tests
- handle c++17 constructs
- add c++17 tests in static-assert-cxx17.cpp
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https
Quuxplusone added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3064
+// If this is a qualified name, expand the template arguments in nested
+// qualifiers.
+DR->getQualifier()->print(OS, PrintPolicy, true);
I don't understand this code enou
courbet updated this revision to Diff 175710.
courbet marked 2 inline comments as done.
courbet added a comment.
expand types in all qualifiers, not only type traits.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
courbet marked 2 inline comments as done.
courbet added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3061
+#define TYPE_TRAIT_N(Spelling, Name, Key) RecordName == (#Spelling + 2) ||
+#include "clang/Basic/TokenKinds.def"
+#undef TYPE_TRAIT_1
Quuxplusone
courbet updated this revision to Diff 175679.
courbet added a comment.
Replace custom printing code with clang helper.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
lib/Sema/SemaTemplate.cpp
test/SemaCXX/stat
Quuxplusone added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3061
+#define TYPE_TRAIT_N(Spelling, Name, Key) RecordName == (#Spelling + 2) ||
+#include "clang/Basic/TokenKinds.def"
+#undef TYPE_TRAIT_1
Why do you bother to check a whitelist of "known"
courbet updated this revision to Diff 175673.
courbet added a comment.
Add unit test with dependent types.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
lib/Sema/SemaTemplate.cpp
test/SemaCXX/static-assert.cp
courbet marked an inline comment as done.
courbet added inline comments.
Comment at: test/SemaCXX/static-assert.cpp:111
+static_assert(std::is_same::value,
"message"); // expected-error{{static_assert failed due to requirement
'std::is_same::value' "message"}}
+static_assert(st
Quuxplusone added inline comments.
Comment at: test/SemaCXX/static-assert.cpp:111
+static_assert(std::is_same::value,
"message"); // expected-error{{static_assert failed due to requirement
'std::is_same::value' "message"}}
+static_assert(std::is_const::value, "message");
courbet updated this revision to Diff 175669.
courbet added a comment.
fix variable name in comment
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
lib/Sema/SemaTemplate.cpp
test/SemaCXX/static-assert.cpp
Inde
courbet added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3076
+return false;
+ const RecordDecl * Record = NNS->getAsRecordDecl();
+ // In namespace "::std".
aaron.ballman wrote:
> Formatting is incorrect here; you should run the patch through c
courbet updated this revision to Diff 175668.
courbet marked 2 inline comments as done.
courbet added a comment.
harden against null getAsRecordDecl().
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
lib/Sema/Sem
courbet updated this revision to Diff 175667.
courbet added a comment.
clang-formant patch
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.org/D54903
Files:
lib/Sema/SemaTemplate.cpp
test/SemaCXX/static-assert.cpp
Index: test/S
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3076
+return false;
+ const RecordDecl * Record = NNS->getAsRecordDecl();
+ // In namespace "::std".
Formatting is incorrect here; you should run the patch through clang-format.
Can
courbet marked an inline comment as done.
courbet added a comment.
Thanks for the comments.
Comment at: lib/Sema/SemaTemplate.cpp:3070
+// and returns true.
+static bool prettyPrintTypeTrait(const NestedNameSpecifier *const NNS,
+ llvm::raw_strin
courbet updated this revision to Diff 175638.
courbet marked 5 inline comments as done.
courbet edited the summary of this revision.
courbet added a comment.
Address Aaron's comments.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54903/new/
https://reviews.llvm.o
Quuxplusone added inline comments.
Comment at: test/SemaCXX/static-assert.cpp:111
+static_assert(std::is_same::value,
"message"); // expected-error{{static_assert failed due to requirement
'std::is_same::value' "message"}}
+static_assert(std::is_const::value, "message");
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaTemplate.cpp:3070
+// and returns true.
+static bool prettyPrintTypeTrait(const NestedNameSpecifier *const NNS,
+ llvm::raw_string_ostream &OS,
No need for the pointer i
31 matches
Mail list logo