| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 78471
|
| |
|
|
| |
llvm-svn: 78274
|
| |
|
|
|
|
|
|
| |
elsewhere. Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.
llvm-svn: 77990
|
| |
|
|
|
|
| |
and a name collision.
llvm-svn: 77658
|
| |
|
|
| |
llvm-svn: 77656
|
| |
|
|
|
|
|
|
|
| |
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.
Removed the ActOnClassTemplate action, which is no longer used.
llvm-svn: 76881
|
| |
|
|
|
|
| |
a destructor.
llvm-svn: 76436
|
| |
|
|
|
|
| |
an incremental patch
llvm-svn: 75622
|
| |
|
|
| |
llvm-svn: 75591
|
| |
|
|
|
|
| |
have an initializer. Also, move some tests around to match the C++0x draft better.
llvm-svn: 75322
|
| |
|
|
| |
llvm-svn: 74833
|
| |
|
|
|
|
| |
from Enea Zaffanella!
llvm-svn: 74831
|
| |
|
|
|
|
|
|
|
| |
ParseDeclarationSpecifiers ... from ParseObjCTypeName)
Another case where we should use SmallVector::data() instead of taking the
address of element 0 of a SmallVector when the SmallVector has no elements.
llvm-svn: 74556
|
| |
|
|
| |
llvm-svn: 74358
|
| |
|
|
| |
llvm-svn: 74307
|
| |
|
|
| |
llvm-svn: 74280
|
| |
|
|
| |
llvm-svn: 74086
|
| |
|
|
|
|
|
| |
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.
llvm-svn: 74021
|
| |
|
|
|
|
|
| |
specialization. At present, all implicit instantiations occur at the
end of the translation unit.
llvm-svn: 73915
|
| |
|
|
|
|
|
|
|
|
|
|
| |
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.
This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.
llvm-svn: 73797
|
| |
|
|
|
|
|
|
| |
data member.
Fixes "test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp" test case.
llvm-svn: 73652
|
| |
|
|
|
|
| |
argument before the function has been declared.
llvm-svn: 73234
|
| |
|
|
| |
llvm-svn: 73101
|
| |
|
|
|
|
| |
at the moment because we ignore the result.
llvm-svn: 73056
|
| |
|
|
| |
llvm-svn: 72664
|
| |
|
|
| |
llvm-svn: 72640
|
| |
|
|
| |
llvm-svn: 72580
|
| |
|
|
|
|
| |
to the DeclGroup.
llvm-svn: 72559
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:
1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.
2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,
struct Point { int x, y, z; } p;
This will help improve AST printing and template instantiation,
among other things.
3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,
int bar(struct T2 { int x; } y) {
struct T2 z;
}
We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:
(struct S { int x, y; } *)0
llvm-svn: 72555
|
| |
|
|
|
|
|
|
| |
'ParseSizeofAlignofExpression' into a new
'ParseExprAfterTypeofSizeofAlignof' method.
llvm-svn: 72256
|
| |
|
|
|
|
|
|
| |
-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;
llvm-svn: 72255
|
| |
|
|
|
|
|
|
| |
redundant functionality. The result (ASTOwningVector) lives in
clang/Parse/Ownership.h and is used by both the parser and semantic
analysis. No intended functionality change.
llvm-svn: 72214
|
| |
|
|
| |
llvm-svn: 72210
|
| |
|
|
| |
llvm-svn: 71930
|
| |
|
|
|
|
|
|
|
| |
template class X<int>;
This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.
llvm-svn: 71608
|
| |
|
|
|
|
|
|
|
|
| |
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.
llvm-svn: 71596
|
| |
|
|
| |
llvm-svn: 71067
|
| |
|
|
|
|
| |
completely.
llvm-svn: 70516
|
| |
|
|
|
|
| |
mean that it's a constructor. Fixes rdar://problem/6815988.
llvm-svn: 70436
|
| |
|
|
| |
llvm-svn: 70389
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:
1. When analyzing a declspec or declarator, if an error is found, we
set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
bit on it from what is in the declarator. From this point on, sema
consistently looks at and sets the bit on the decl.
This gives a very clear separation of concerns and simplifies a bunch
of code. In addition to this, this patch makes these changes:
1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
methods now set invalid on the decl returned instead of returning an
invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
bit into the resultant type. Stuff declared with the invalid typedef
will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
invalid bit on the decl they check.
There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this
next.
llvm-svn: 70020
|
| |
|
|
|
|
|
|
| |
by correctly propagating the fact that the type was invalid up to the
attributeRuns decl, then returning an ExprError when attributeRuns is
formed (like we do for normal declrefexprs).
llvm-svn: 69998
|
| |
|
|
| |
llvm-svn: 69642
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nested name specifiers. Now we emit stuff like:
t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~ ^
instead of:
t.cpp:8:16: error: invalid token after top level declarator
static foo::X P;
^
This is inspired by a really awful error message I got from
g++ when I misspelt diag::kind as diag::Kind.
llvm-svn: 69086
|
| |
|
|
|
|
|
| |
ParseDeclarationSpecifiers into its own function, no
functionality change.
llvm-svn: 69083
|
| |
|
|
|
|
| |
int in a bitfield. Shantonu found this in a gcc testsuite file.
llvm-svn: 69074
|
| |
|
|
| |
llvm-svn: 68921
|
| |
|
|
|
|
| |
to isValidAfterIdentifierInDeclarator, as suggested by Sebastian.
llvm-svn: 68920
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that I noticed working on other things.
Instead of emitting:
t2.cc:1:8: error: use of undeclared identifier 'g'
int x(*g);
^
t2.cc:1:10: error: expected ')'
int x(*g);
^
t2.cc:1:6: note: to match this '('
int x(*g);
^
We now only emit:
t2.cc:1:7: warning: type specifier missing, defaults to 'int'
int x(*g);
^
Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still
not great, we now produce both of:
void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \
expected-error {{variable has incomplete type 'void'}}
The second diagnostic should be silenced by something getting marked invalid.
I don't plan to fix this though.
llvm-svn: 68919
|
| |
|
|
|
|
| |
this allows downstream diags to be properly silenced.
llvm-svn: 68917
|