[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2023-01-25 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf4a6842c5a4d: [clang][Interp] Reject invalid declarations and expressions (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 ___ cfe-commits mailing lis

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 474727. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/functions.cpp Index: clang/test/A

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 474726. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/functions.cpp Index: clang/test/A

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1235-1236 bool ByteCodeExprGen::visitDecl(const VarDecl *VD) { - Optional VarT = classify(VD->getType()); + if (VD->isInvalidDecl()) +return false; Because we can't

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/test/AST/Interp/functions.cpp:88-97 +constexpr int invalid() { + // Invalid expression in visit(). + while(huh) {} +} + +constexpr void invalid2() { + int i = 0; aaron.b

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 474172. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/functions.cpp Index: clang/test/AST/Interp/functions.cpp ==

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/Interp/functions.cpp:88-97 +constexpr int invalid() { + // Invalid expression in visit(). + while(huh) {} +} + +constexpr void invalid2() { + int i = 0; There should definitely be diagnostics here

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 473939. tbaeder added a comment. Tried to find an example for an invalid declaration but couldn't even manage to find one :| CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137386/new/ https://reviews.llvm.org/D137386 Files: clang/lib/AST/Interp/B

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I'd like to see some test coverage for what these changes catch that wasn't caught before. On its face, this seems reasonable in that we don't want to bother running the interpreter (further) once we know we've hit an expression, declaration, or type that's not va

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

2022-11-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. I'm not really sure if this is the right thing to d