| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
It's not safe to blindly call getIdentifierInfo without checking the
token is not an annotation token.
llvm-svn: 225533
|
|
|
|
|
|
|
|
|
|
|
| |
Parser::ParseNamespace can get a little confused when it found itself
inside a compound statement inside of a non-static data member
initializer.
Try to determine that the statement expression's scope makes sense
before trying to parse it's contents.
llvm-svn: 225514
|
|
|
|
|
|
|
|
|
| |
Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo.
Don't let the AST contain the malformed lambda.
This fixes PR22122.
llvm-svn: 225505
|
|
|
|
| |
llvm-svn: 225129
|
|
|
|
| |
llvm-svn: 225122
|
|
|
|
|
|
|
| |
Weird constructs like __attribute__((inline)) or
__attibute__((typename)) should result in warnings, not errors.
llvm-svn: 225118
|
|
|
|
|
|
| |
That's what I get for last second changes...
llvm-svn: 224967
|
|
|
|
|
|
|
| |
Instead of crashing, recover by eating the extra trailing scope
qualifier. This means we will treat 'struct A:: {' as 'struct A {'.
llvm-svn: 224966
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to r224915. This adds a bit more line noise to the tests
added in that revision to make sure the parser is ready for a toplevel decl
after each incorrect line. Use this to move the tests up to where they belong.
This uncovered that the early return was missing a call to
ActOnTagDefinitionError(), so add that. (Also fixes at least one of the crashes
on SLi's bot.)
llvm-svn: 224958
|
|
|
|
|
|
|
| |
Let's pretend that we didn't see the '::' instead of go on believing
that we've got some anonymous, but globally qualified, struct.
llvm-svn: 224945
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r168626 added nicer diagnostics for attributes in the wrong places, such as
after the `final` on a class. To do this, it added code that did high-level
pattern matching for e.g. 'final' 'alignas' '(' and then skipped until the
closing ')'. If it saw that, it then went down the regular class parsing
path and then called MaybeParseCXX11Attributes() to parse the attribute after
the 'final' using real attribute parsing code. On invalid attributes, the
real attribute parsing code could eat more tokens than the pattern matching
code and for example skip past the '{' starting the class, which would then
lead to an assert. To prevent this, check for a good state after calling
MaybeParseCXX11Attributes() (which morphed into CheckMisplacedCXX11Attribute()
in r175575) and bail out if things look bleak.
Found by SLi's afl bot.
llvm-svn: 224915
|
|
|
|
|
|
|
|
| |
Clang has a hack to accept definitions of structs with tag names which
have the same name as intrinsics. However, this hack didn't guard
against annotation tokens showing up in the token stream.
llvm-svn: 224909
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes this snippet from SLi's afl fuzzer output:
class {
i (x = <, enum
This parsed i as a function, x as a paramter, and the stuff after < as a
template list. This then called TryConsumeDeclarationSpecifier() which
called TryAnnotateCXXScopeToken() without checking the preconditions of
this function. Check them before calling, like all other callers of
TryAnnotateCXXScopeToken() do.
A more readable reproducer that causes the same crash is
class {
void i(int x = MyTemplateClass<int, union int>::foo());
};
The reduced version used an eof token as surprising token, but kw_int works
just as well to repro and is easier to insert into a test file.
llvm-svn: 224906
|
|
|
|
|
|
|
|
|
| |
isDeclarationSpecifier performs error recovers which jostles the token
stream. Specifically, TryAnnotateTypeOrScopeToken will end up consuming
a typename token which will confuse the attribute parsing machinery as
we no-longer have something identifier-like.
llvm-svn: 224903
|
|
|
|
| |
llvm-svn: 224893
|
|
|
|
|
|
| |
the statement attributes (as per the standard), and function-try-blocks may not have attributes. NFC.
llvm-svn: 224662
|
|
|
|
|
|
| |
when we diagnose this as an error.
llvm-svn: 224595
|
|
|
|
| |
llvm-svn: 224562
|
|
|
|
|
|
| |
declared return type (including a trailing-return-type in C++14).
llvm-svn: 224561
|
|
|
|
|
|
| |
Fixes PR21947.
llvm-svn: 224558
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ParseCXXNonStaticMemberInitializer stashes away all the tokens for the
initializer and an additional EOF token to denote where the initializer
ends. However, it is possible for ParseLexedMemberInitializer to get
its hands on the "real" EOF token; since the two tokens are
indistinguishable, we end up consuming the EOF and descend into madness.
Instead, make it possible to tell which EOF token we are looking at.
This fixes PR21872.
llvm-svn: 224505
|
|
|
|
| |
llvm-svn: 224434
|
|
|
|
|
|
|
|
|
| |
We would consume the lparen even if it wasn't followed by an identifier
or a star-identifier pair.
This fixes PR21815.
llvm-svn: 224403
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser can only be tricked into parsing a function template
definition by inserting a typename keyword before the function template
declaration. This used to make us crash, and now it's fixed.
While here, remove an unneeded boolean parameter from ParseDeclGroup.
This boolean always corresponded to non-typedef declarators at file
scope. ParseDeclGroup already has precise diagnostics for the function
definition typedef case, so we can let that through.
Fixes PR21839.
llvm-svn: 224287
|
|
|
|
|
|
|
|
|
| |
We would crash trying to treat a property member as a field. These
shoudl be forbidden anyway, reject programs which contain them.
This fixes PR21840.
llvm-svn: 224193
|
|
|
|
|
|
|
|
| |
expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.
The testcase shows a third bug with a FIXME in it.
llvm-svn: 224183
|
|
|
|
|
|
|
|
|
|
| |
While we would correctly handle asm("foo") and reject asm(L"bar"), we
weren't careful to handle cases where an ascii literal could be
concatenated with a wide literal.
This fixes PR21822.
llvm-svn: 223992
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in debugger mode) to accept @import declarations
and pass them to the debugger.
In the preprocessor, accept import declarations
if the debugger is enabled, but don't actually
load the module, just pass the import path on to
the preprocessor callbacks.
In the Objective-C parser, if it sees an import
declaration in statement context (usual for LLDB),
ignore it and return a NullStmt.
llvm-svn: 223855
|
|
|
|
|
|
| |
MSVC parses and ignores these with a warning.
llvm-svn: 223413
|
|
|
|
|
|
|
|
| |
The __unaligned keyword can appear after a struct definition:
struct foo {...} __unaligned *x;
llvm-svn: 223412
|
|
|
|
|
|
|
|
| |
should indicate a c++ parameter pack not a c-variadic.
int i = [](auto...) { return 0; }(); // OK now.
llvm-svn: 223357
|
|
|
|
|
|
| |
ParsePostfixExpressionSuffix.
llvm-svn: 223209
|
|
|
|
| |
llvm-svn: 223177
|
|
|
|
|
|
|
| |
Also have CorrectDelayedTyposInExpr check that the Expr* isn't null
before trying to access its members. Fixes PR21679.
llvm-svn: 223162
|
|
|
|
|
|
| |
consideration for C++17 for now. Update C++ status page to match.
llvm-svn: 222865
|
|
|
|
|
|
|
|
|
|
| |
To support it in the frontend, the following has been added:
- generic address space type attribute;
- documentation for the OpenCL address space attributes;
- parsing of __generic(generic) keyword;
- test code for the parser and diagnostics.
llvm-svn: 222831
|
|
|
|
| |
llvm-svn: 222665
|
|
|
|
|
|
| |
when calling DiagnoseEmptyLookup.
llvm-svn: 222551
|
|
|
|
|
|
|
|
| |
std::X::swap exception specifications (allowing parsing of non-conforming code
in libstdc++). The old conditions also matched the functions in MSVC's STL,
which were relying on deferred parsing here.
llvm-svn: 222471
|
|
|
|
|
|
|
|
|
| |
Sema::ActOnIdExpression to use the new functionality.
Among other things, this allows recovery in several cases where it
wasn't possible before (e.g. correcting a mistyped static_cast<>).
llvm-svn: 222464
|
|
|
|
|
|
| |
pair<iterator, bool> as per the C++ standard's associative container concept.
llvm-svn: 222335
|
|
|
|
|
|
|
|
|
|
|
|
| |
a member named 'swap' and then expect unqualified lookup for the name 'swap' in
its exception specification to find anything else.
Without delay-parsed exception specifications, this was ill-formed (NDR) by
[basic.scope.class]p1, rule 2. With delay-parsed exception specifications, the
call to 'swap' unambiguously finds the function being declared, which then
fails because the arguments don't work for that function.
llvm-svn: 221955
|
|
|
|
|
|
|
| |
is a re-commit of Doug's r154844 (modernized and updated to fit into current
Clang).
llvm-svn: 221918
|
|
|
|
|
|
|
|
|
| |
For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>);
In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>);
Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info.
Differential Revision: http://reviews.llvm.org/D4002
llvm-svn: 221663
|
|
|
|
|
|
|
| |
parenthesized expression a bit differently in this case, just in case the
commas have special meaning.
llvm-svn: 221661
|
|
|
|
|
|
| |
(This sometimes happens when a macro is used that expands to either the GNU noreturn attribute or _Noreturn.)
llvm-svn: 221630
|
|
|
|
|
|
| |
use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580.
llvm-svn: 221581
|
|
|
|
| |
llvm-svn: 221580
|
|
|
|
| |
llvm-svn: 221576
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows 'namespace A::B { ... }' as a shorthand for 'namespace A {
namespace B { ... } }'. We already supported this correctly for error recovery;
promote that support to a full implementation.
This is not the right implementation: we do not maintain source fidelity
because we desugar the nested namespace definition in the parser. This is
tricky to avoid, since the definition genuinely does inject one named
entity per level in the namespace name.
llvm-svn: 221574
|