| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
has special treatment. Also fixes a minor bug where the attributes were being parsed as though they were GNU-style attributes when they were in fact keyword attributes.
llvm-svn: 197629
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we emit diagnostics for keyword-as-identifier hacks (-Wkeyword-compat)
we can go ahead and simplify some of the old revertible keyword support.
This commit adds a TryIdentKeywordUpgrade() function to mirror the recently
added TryKeywordIdentFallback() and uses it to replace the hard-coded list of
REVERTIBLE_TYPE_TRAITs.
llvm-svn: 197496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We would skip until the next comma, hoping good things whould lie there,
however this would fail when we have such things as this:
struct A {};
template <typename>
struct D;
template <>
struct D<C> : B, A::D;
Once this happens, we would believe that D with a nested namespace
specifier of A was a variable that was being declared. We would go on
to complain that there was an extraneous 'template <>' on their variable
declaration.
Crashes would happen when 'A' gets defined as 'enum class A {}' as
various asserts would fire.
Instead, we should skip up until the semicolon if we see that we are in
the middle of a definition and the current token is a ':'
This fixes PR17084.
llvm-svn: 196453
|
|
|
|
|
|
| |
simple-template-ids (eg, 'operator+<int>') in weird places.
llvm-svn: 196333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.
Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.
This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.
Implementation returns bool for symmetry with token annotation functions.
Some examples:
warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod
warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;
llvm-svn: 196212
|
|
|
|
|
|
|
|
|
|
| |
MSVC applies these to the following declaration only if present, otherwise
silently ignores them whereas we'll issue a warning.
Handling differs from ordinary attributes appearing in the same place, so add a
Sema test to make sure we get it right.
llvm-svn: 195577
|
|
|
|
|
|
|
|
|
| |
module. Use the marker to diagnose cases where we try to transition between
submodules when not at the top level (most likely because a closing brace was
missing at the end of a header file, but is also possible if submodule headers
attempt to do something fundamentally non-modular, like our .def files).
llvm-svn: 195543
|
|
|
|
|
|
|
|
| |
and we see an ill-formed declarator that would probably be well-formed if the
tag definition were just missing a semicolon, use that as the diagnostic
instead of producing some other mysterious error.
llvm-svn: 195163
|
|
|
|
| |
llvm-svn: 194994
|
|
|
|
| |
llvm-svn: 194872
|
|
|
|
|
|
|
| |
definition. If we see something that looks like a namespace definition inside a
class, that strongly indicates that a close brace was missing somewhere.
llvm-svn: 194319
|
|
|
|
| |
llvm-svn: 194281
|
|
|
|
| |
llvm-svn: 194274
|
|
|
|
|
|
| |
and we know where they go.
llvm-svn: 193297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'final'
Summary: Some MS headers use these features.
Reviewers: rnk, rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1948
llvm-svn: 192936
|
|
|
|
|
|
| |
a patch by Michael Han.
llvm-svn: 192666
|
|
|
|
|
|
| |
argument list.
llvm-svn: 189711
|
|
|
|
|
|
| |
do anything useful.
llvm-svn: 189548
|
|
|
|
|
|
| |
Differential Revision: http://llvm-reviews.chandlerc.com/D924
llvm-svn: 188133
|
|
|
|
|
|
| |
fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...
llvm-svn: 187762
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.
However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.
While we are here, clean up the code a bit.
Fixes PR16765
llvm-svn: 187557
|
|
|
|
|
|
|
|
|
|
|
|
| |
No functionality change.
In Sema helper functions:
* renamed isTypeName as HasTypenameKeyword
In UsingDecl:
* renamed get/setUsingLocation to get/setUsingLoc
* renamed is/setTypeName as has/setTypename
llvm-svn: 186816
|
|
|
|
|
|
|
|
| |
Sema::ActOnDocumentableDecls.
Patch by Robert Wilhelm.
llvm-svn: 185931
|
|
|
|
| |
llvm-svn: 185765
|
|
|
|
|
|
| |
avoid specifying the vector size unnecessarily.
llvm-svn: 185610
|
|
|
|
|
|
| |
Patch by Robert Wilhelm.
llvm-svn: 184675
|
|
|
|
|
|
| |
a typo that caused a runtime assertion after firing diagnosis for class definitions, with the 'template' keyword as template header, in friend declarations.
llvm-svn: 184634
|
|
|
|
|
|
| |
(FixIts yet to be tested.)
llvm-svn: 184503
|
|
|
|
|
|
| |
showing "(null)".
llvm-svn: 184377
|
|
|
|
|
|
|
|
|
| |
- 'register' storage class
- dynamic exception specifications
Only the former check is enabled by default for now (the latter might be quite noisy).
llvm-svn: 183881
|
|
|
|
| |
llvm-svn: 181565
|
|
|
|
| |
llvm-svn: 180610
|
|
|
|
|
|
|
| |
using-declarations with names which look constructor-like are interpreted as
constructor names.
llvm-svn: 177957
|
|
|
|
| |
llvm-svn: 177705
|
|
|
|
|
|
| |
in C++98.
llvm-svn: 175879
|
|
|
|
|
|
| |
and we used to assert if it did.
llvm-svn: 175866
|
|
|
|
|
|
|
| |
diagnose attributes on alias declarations, using directives, and attribute
declarations.
llvm-svn: 175649
|
|
|
|
|
|
|
|
| |
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.
llvm-svn: 175575
|
|
|
|
|
|
|
| |
Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.
llvm-svn: 174768
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the member has an initializer, assume it was probably intended to be static
and suggest/recover with that.
If the member doesn't have an initializer, assume it was probably intended to
be const instead of constexpr and suggest that.
(if the attempt to apply these changes fails, don't make any suggestion &
produce the same diagnostic experience as before. The only case where this can
come up that I know of is with a mutable constexpr with an initializer, since
mutable is incompatible with static (but it's already incompatible with
const anyway))
llvm-svn: 173873
|
|
|
|
|
|
|
|
|
| |
the diagnostic's warn_ name. Switch some places (notably C++11 attributes)
which really wanted an error over to a different diagnostic. Finally, suppress
the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing
diagnostics in important system headers.
llvm-svn: 173788
|
|
|
|
|
|
|
| |
It turns out that there's no correctness bug here (because we can't have a type
definition in this location), but there was a diagnostic bug.
llvm-svn: 173766
|
|
|
|
| |
llvm-svn: 172886
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r159549 / r159164 regressed clang to reject
struct s {};
struct s
operator++(struct s a)
{ return a; }
This fixes the regression. Richard, pleas check if this looks right.
llvm-svn: 172834
|
|
|
|
| |
llvm-svn: 172701
|
|
|
|
|
|
|
|
| |
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).
llvm-svn: 172691
|
|
|
|
|
|
| |
brought into 'clang' namespace by clang/Basic/LLVM.h
llvm-svn: 172323
|
|
|
|
| |
llvm-svn: 171894
|
|
|
|
|
|
|
|
|
|
| |
Following r168626, in class declaration or definition, there are a combination of syntactic locations
where C++11 attributes could appear, and among those the only valid location permitted by standard is
between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to
move them to expected location and we recover by applying them to the class specifier.
llvm-svn: 171757
|
|
|
|
|
|
| |
nearby 'C++0x' comments.
llvm-svn: 171372
|