[PATCH] D64811: Warn when NumParams overflows

2019-08-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:6233 + + } else if (RequiresArg) Diag(Tok, diag::err_argument_required_after_attribute); The re-indentation here is wrong. Comment at: clang/lib/Sema/SemaDeclCXX.

[PATCH] D64811: Warn when NumParams overflows

2019-08-15 Thread Mark de Wever via Phabricator via cfe-commits
Mordante updated this revision to Diff 215425. Mordante added a comment. Moved the testing from Parse to Sema. Added additional safeguards for template instantiation. Added more unit tests. The comments may be a bit noisy, but they explain why the templates need to be tested at two locations. C

[PATCH] D64811: Warn when NumParams overflows

2019-08-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:6673 + // Avoid exceeding the maximum function parameters + // See https://bugs.llvm.org/show_bug.cgi?id=19607 + if (ParamInfo.size() > Type::getMaxNumParams()) { Mordante wrote: > rjmcc

[PATCH] D64811: Warn when NumParams overflows

2019-07-31 Thread Mark de Wever via Phabricator via cfe-commits
Mordante marked an inline comment as done. Mordante added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:6673 + // Avoid exceeding the maximum function parameters + // See https://bugs.llvm.org/show_bug.cgi?id=19607 + if (ParamInfo.size() > Type::getMaxNumParams())

[PATCH] D64811: Warn when NumParams overflows

2019-07-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:6673 + // Avoid exceeding the maximum function parameters + // See https://bugs.llvm.org/show_bug.cgi?id=19607 + if (ParamInfo.size() > Type::getMaxNumParams()) { rjmccall wrote: > We do

[PATCH] D64811: Warn when NumParams overflows

2019-07-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/AST/Type.h:1523 + enum { NumParamsBits = 16 }; + This should probably go in `FunctionTypeBitfields`. Comment at: clang/lib/Parse/ParseDecl.cpp:6673 + // Avoid exceeding the max

[PATCH] D64811: Warn when NumParams overflows

2019-07-16 Thread Mark de Wever via Phabricator via cfe-commits
Mordante created this revision. Mordante added reviewers: rsmith, rjmccall. Mordante added a project: clang. Before when the overflow occurred an assertion was triggered. Now check whether the maximum has been reached and warn properly. This patch fixes bug 33162 which is marked as 'duplicate' o