[PATCH] Warn on duplicate function specifier
Richard Smith
richard at metafoo.co.uk
Fri Oct 25 13:07:02 PDT 2013
================
Comment at: include/clang/Sema/DeclSpec.h:638-644
@@ -641,1 +637,9 @@
+ bool setFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec,
+ unsigned& DiagID);
+ bool setFunctionSpecVirtual(SourceLocation Loc, const char *&PrevSpec,
+ unsigned& DiagID);
+ bool setFunctionSpecExplicit(SourceLocation Loc, const char *&PrevSpec,
+ unsigned& DiagID);
+ bool setFunctionSpecNoreturn(SourceLocation Loc, const char *&PrevSpec,
+ unsigned& DiagID);
----------------
`" &"`, not `"& "`, please.
================
Comment at: lib/Parse/ParseDecl.cpp:2770
@@ -2769,3 +2769,3 @@
case tok::kw___forceinline: {
- isInvalid = DS.setFunctionSpecInline(Loc);
+ isInvalid = DS.setFunctionSpecInline(Loc, PrevSpec, DiagID);
IdentifierInfo *AttrName = Tok.getIdentifierInfo();
----------------
Do we really want a diagnostic for combining `inline` with `__forceinline`? That combination doesn't seem unreasonable to me.
http://llvm-reviews.chandlerc.com/D2025
More information about the cfe-commits
mailing list