Peter Collingbourne
62c219809c
Correct the grammar for __builtin_astype.
...
llvm-svn: 143777
2011-11-05 03:47:48 +00:00
Eli Friedman
055c970839
Add an option to emulate the strange Apple gcc behavior of #pragma pack.
...
<rdar://problem/10374763>
llvm-svn: 143527
2011-11-02 01:53:16 +00:00
David Blaikie
dd58d4ca8f
Handle redundant 'typename' on base class specifications.
...
llvm-svn: 142937
2011-10-25 18:46:41 +00:00
David Blaikie
afa155fb88
Fix erroneous name-specifiers prior to decltypes better/correctly as per Doug's feedback.
...
llvm-svn: 142935
2011-10-25 18:17:58 +00:00
David Blaikie
b75951f477
Initialize the BaseLoc for decltype base type specifications.
...
llvm-svn: 142929
2011-10-25 17:14:10 +00:00
David Blaikie
1cd50022b2
Fix cases where the optional nested-name-specifier erroneously preceeded a decltype-specification when specifying a base type.
...
llvm-svn: 142928
2011-10-25 17:10:12 +00:00
David Blaikie
00ee7a081d
Support the use of decltype for specifying base types. Fixes PR11216.
...
llvm-svn: 142926
2011-10-25 15:01:20 +00:00
Douglas Gregor
4a2a8f7fb8
Check for unexpanded parameter packs in the name that guards a
...
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.
llvm-svn: 142906
2011-10-25 03:44:56 +00:00
Douglas Gregor
deb4a2be67
Implement support for dependent Microsoft __if_exists/__if_not_exists
...
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".
llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Douglas Gregor
43edb32f1f
Rework Microsoft __if_exists/__if_not_exists parsing and semantic
...
analysis to separate dependent names from non-dependent names. For
dependent names, we'll behave differently from Visual C++:
- For __if_exists/__if_not_exists at class scope, we'll just warn
and then ignore them.
- For __if_exists/__if_not_exists in statements, we'll treat the
inner statement as a compound statement, which we only instantiate
in templates where the dependent name (after instantiation)
exists. This behavior is different from VC++, but it's as close as
we can get without encroaching ridiculousness.
The latter part (dependent statements) is not yet implemented.
llvm-svn: 142864
2011-10-24 22:31:10 +00:00
Peter Collingbourne
ccbcce0219
Simplify parsing ellipsis in Parser::ParseAlignArgument, spotted by Doug.
...
llvm-svn: 142814
2011-10-24 17:56:00 +00:00
Peter Collingbourne
7d33cd3a2f
Fix grammar for C++11 alignment specifiers, and add a few FIXMEs.
...
llvm-svn: 142760
2011-10-23 20:07:52 +00:00
Douglas Gregor
60060d6f8f
Treat the Microsoft/Borland keyword "__except" as a context-sensitive
...
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.
llvm-svn: 142636
2011-10-21 03:57:52 +00:00
Richard Smith
f411196d15
'extern template' is a C++11 feature. Add an Extension for C++98 (this matches
...
gcc's behaviour), and a -Wc++98-compat-pedantic warning for C++11.
llvm-svn: 142597
2011-10-20 18:35:58 +00:00
Richard Smith
09f76ee63c
Improve the diagnostic when a comma ends up at the end of a declarator group
...
instead of a semicolon (as sometimes happens during refactorings). When such a
comma is seen at the end of a line, and is followed by something which can't
possibly be a declarator (or even something which might be a plausible typo for
a declarator), suggest that a semicolon was intended.
llvm-svn: 142544
2011-10-19 21:33:05 +00:00
Douglas Gregor
e248eea214
Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!
...
llvm-svn: 142478
2011-10-19 06:04:55 +00:00
Fariborz Jahanian
7f73302b4f
objc: allow class name qualified with protocols in
...
iboutletcollection attribute. But ignore protocol
list. // rdar://10296078
llvm-svn: 142459
2011-10-18 23:13:50 +00:00
Fariborz Jahanian
6b70865ec0
objc: diagnose invalid argument to an
...
iboutletcollection attribute intead of crashing.
// rdar://10296078
llvm-svn: 142364
2011-10-18 17:11:10 +00:00
Richard Smith
b15c11c819
Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
...
'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'.
llvm-svn: 142302
2011-10-17 23:06:20 +00:00
Richard Smith
b12bf69769
Refactor __attribute__ parsing, and add a diagnostic if the r_paren at the end
...
of an attrib is missing. gcc does not allow the closing parenthesis to be omitted.
llvm-svn: 142255
2011-10-17 21:20:17 +00:00
Douglas Gregor
50cefbf212
When we end up having to parse the initializer of a C++ member early
...
in -fms-extensions mode, make sure we actually use that initializer
after having handled the declaration. Fixes PR11150.
llvm-svn: 142195
2011-10-17 17:09:53 +00:00
Erik Verbruggen
fd979b1eaf
Fixed merge-mistake where ActOnAccessSpecifier was called twice for every access specifier. The testcase has been changed to catch this too.
...
llvm-svn: 142186
2011-10-17 09:54:52 +00:00
Richard Smith
5d164bc5e0
Implement -Wc++98-compat warnings for the parser.
...
llvm-svn: 142056
2011-10-15 05:09:34 +00:00
Richard Smith
da2611199b
Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.
...
llvm-svn: 142054
2011-10-15 04:21:46 +00:00
Richard Smith
bffe88027c
Rename an ExtWarn to ext_ for consistency.
...
llvm-svn: 142049
2011-10-15 03:55:17 +00:00
Richard Smith
2db9652b5a
Don't warn about use of 'final' in ill-formed C++98 code which didn't use
...
'final', and don't accept (then silently discard) braced init lists in C++98
new-expressions.
llvm-svn: 142048
2011-10-15 03:38:41 +00:00
Anton Korobeynikov
f0c267e6e0
Provide half floating point support as a storage only type.
...
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Richard Smith
f679b5b6a6
-Wc++98-compat: warn on C++11 attributes and alignas.
...
llvm-svn: 141999
2011-10-14 20:48:27 +00:00
Richard Smith
96bd62f769
Reinstate r141898 (reverted in r141921), without the -Wc++98-compat-variadic-templates flag. Consensus is that -Wc++98-compat is a useful addition to clang, but per-C++11-feature warnings may not be.
...
Original patch by Jeffrey Yasskin.
llvm-svn: 141985
2011-10-14 20:31:37 +00:00
Jeffrey Yasskin
de8a104633
Revert the -Wc++98-compat flag because dgregor doesn't like it.
...
llvm-svn: 141921
2011-10-14 00:04:00 +00:00
Jeffrey Yasskin
a722170eb9
Implement the first piece of a -Wc++98-compat flag so that people can build in
...
C++11 mode but keep their sources compatible with C++98. This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.
llvm-svn: 141898
2011-10-13 22:18:05 +00:00
Erik Verbruggen
ca98f2a63f
Allow for annotate attributes after access specifiers. When such
...
attributes are found, propagate them to subsequent declarations.
llvm-svn: 141861
2011-10-13 09:41:32 +00:00
David Blaikie
eba32c2229
Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++
...
llvm-svn: 141852
2011-10-13 06:08:43 +00:00
Douglas Gregor
e7a8e3b612
Introduce BalancedDelimiterTracker, to better track open/close
...
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!
llvm-svn: 141782
2011-10-12 16:37:45 +00:00
John McCall
50a2c2c19d
Catch placeholder types in DefaultLvalueConversion
...
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
llvm-svn: 141738
2011-10-11 23:14:30 +00:00
Kaelyn Uhrain
85308c6ecd
Add typo correction for type names.
...
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.
llvm-svn: 141621
2011-10-11 01:02:41 +00:00
Kaelyn Uhrain
4dc695daea
Move some bool flags out of function parameter lists.
...
llvm-svn: 141610
2011-10-11 00:28:45 +00:00
Douglas Gregor
728d00b8e7
Parse the initializer for a class member after handling its
...
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.
llvm-svn: 141539
2011-10-10 14:49:18 +00:00
NAKAMURA Takumi
93eafc6ce1
Fix "Uninitialized" warnings.
...
llvm-svn: 141487
2011-10-08 11:31:53 +00:00
NAKAMURA Takumi
82a351197f
Whitespace
...
llvm-svn: 141486
2011-10-08 11:31:46 +00:00
Douglas Gregor
6f981006f6
Add braces around do-while body. The lack of them gives me the chills
...
llvm-svn: 141411
2011-10-07 20:35:25 +00:00
Argyrios Kyrtzidis
9321ad3f97
When using an unavailable/deprecated interface Foo inside Foo's interface/implementation
...
don't emit unavailable errors.
llvm-svn: 141334
2011-10-06 23:23:20 +00:00
Eli Friedman
0dfb889575
Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
...
Thanks to Jeffrey Yasskin for the thorough review!
llvm-svn: 141330
2011-10-06 23:00:33 +00:00
Peter Collingbourne
485b80fecc
OpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,
...
which enables support for C99 storage-class specifiers.
This extension is intended to be used by implementations to implement
OpenCL C built-in functions.
llvm-svn: 141271
2011-10-06 03:01:00 +00:00
Peter Collingbourne
6a0e48c746
OpenCL: disallow '#pragma OPENCL EXTENSION all : enable', per OpenCL 1.1 9.1
...
llvm-svn: 141270
2011-10-06 03:00:50 +00:00
Argyrios Kyrtzidis
dfd6570643
Pass from the parser the locations of selector identifiers when creating
...
objc method decls.
They are not stored in the AST yet.
llvm-svn: 140984
2011-10-03 06:36:36 +00:00
Argyrios Kyrtzidis
f934ec8b7b
Pass all the locations of the selector identifiers for a message expression from the parser.
...
They are not kept in the AST yet.
llvm-svn: 140982
2011-10-03 06:36:17 +00:00
John McCall
a55902bf98
Parse attributes written in an ObjC method parameter type as
...
attributes on the parameter declaration.
llvm-svn: 140944
2011-10-01 09:56:14 +00:00
Sebastian Redl
0d16401228
Fix a bug in the token caching for inline constructors in C++11, and improve error recovery in both dialects. This should fix the GCC test suite failures as well.
...
llvm-svn: 140847
2011-09-30 08:32:17 +00:00
Eli Friedman
a4b02c30de
Some fixes for MS-style asm parsing: specifically, add some error checking, and handle asm comments using semicolons correctly. (The comments are actually surprisingly tricky.)
...
llvm-svn: 140837
2011-09-30 01:13:51 +00:00