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.
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
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
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())
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
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
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