Richard Smith
ee6311df69
In C++0x, static const volatile data members cannot be initialized in-class.
...
llvm-svn: 140809
2011-09-29 21:28:14 +00:00
Richard Smith
2316cd8b79
constexpr: semantic checking for constexpr variables.
...
We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier).
llvm-svn: 140801
2011-09-29 19:11:37 +00:00
Bill Wendling
d9dcf18cb0
Revert r140589. It was causing failures during llvm compilation:
...
llvm[1]: Compiling CommandLine.cpp for Debug+Asserts build
if /Users/void/llvm/llvm-opt.obj/Release+Asserts/bin/clang++ -I/Users/void/llvm/llvm.obj/include -I/Users/void/llvm/llvm.obj/lib/Support -I/Users/void/llvm/llvm.src/include -I/Users/void/llvm/llvm.src/lib/Support -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -m64 -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d" /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp -o /Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o ; \
then /bin/mv -f "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d"; else /bin/rm "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp"; exit 1; fi
In file included from /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp:25:
/Users/void/llvm/llvm.src/include/llvm/Support/system_error.h:690:14: error: unknown type name 'make_error_condition'; did you mean 'error_condition'?
{*this = make_error_condition(_e);}
^~~~~~~~~~~~~~~~~~~~
error_condition
...
llvm-svn: 140599
2011-09-27 10:09:33 +00:00
Kaelyn Uhrain
d889d2461f
Add typo correction for the type name in C++ "new" statements
...
llvm-svn: 140589
2011-09-27 00:33:13 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
Douglas Gregor
b1fa148837
Don't propagate the 'availability' attribute through declaration
...
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.
llvm-svn: 140406
2011-09-23 20:23:42 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
David Blaikie
751c558d8e
ArrayRef-ifying the fields passed to Sema::ActOnFields
...
llvm-svn: 140293
2011-09-22 02:58:26 +00:00
David Blaikie
9c70e04bec
ArrayRef-ifying Function/BlockDecl's setParams
...
llvm-svn: 140268
2011-09-21 18:16:56 +00:00
Francois Pichet
3b4de99158
[microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility. Also allow the missing typename warning at function scope.
...
llvm-svn: 140240
2011-09-21 07:59:49 +00:00
Peter Collingbourne
9a8f1534d9
Remove redundant break statements, and replace asserts with llvm_unreachable
...
Per John's review comments for r140068.
llvm-svn: 140142
2011-09-20 12:40:26 +00:00
Peter Collingbourne
2dbb708b8a
OpenCL: introduce support for function scope __local variables
...
llvm-svn: 140068
2011-09-19 21:14:35 +00:00
Richard Smith
4037235429
Fix PR10531. Attach an initializer to anonymous unions, since the default constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted.
...
llvm-svn: 139991
2011-09-18 00:06:34 +00:00
Francois Pichet
0706d203cf
Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.
...
Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.
llvm-svn: 139987
2011-09-17 17:15:52 +00:00
Kaelyn Uhrain
7fbe2f78d7
Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration
...
llvm-svn: 139718
2011-09-14 19:37:32 +00:00
Douglas Gregor
79a91418bd
Switch LangOptions over to a .def file that describes header of the
...
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.
AST serialization changes are next up.
llvm-svn: 139605
2011-09-13 17:21:33 +00:00
Douglas Gregor
7bfedd69c5
Kill off an irrelevant FIXME
...
llvm-svn: 139523
2011-09-12 18:58:37 +00:00
Douglas Gregor
41866816ce
Diagnose attempt to mark function-local declarations as __module_private__.
...
llvm-svn: 139519
2011-09-12 18:37:38 +00:00
Douglas Gregor
3baa6702ab
Allow __module_private__ on fields
...
llvm-svn: 139499
2011-09-12 16:11:24 +00:00
Julien Lerouge
5a6b6987dc
Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
...
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.
llvm-svn: 139423
2011-09-09 22:41:49 +00:00
Douglas Gregor
3c7cd6a0c4
Specializations cannot be module-hidden. Diagnose attempts to do so.
...
llvm-svn: 139406
2011-09-09 20:53:38 +00:00
Douglas Gregor
2820e6923a
__module_private__ is inherited by redeclarations of an entity, and
...
must also be present of the first declaration of that entity.
llvm-svn: 139384
2011-09-09 19:05:14 +00:00
Douglas Gregor
ef15bdbe1a
Propagate __module_private__ from previous declarations to later
...
declarations.
llvm-svn: 139380
2011-09-09 18:32:39 +00:00
Douglas Gregor
26701a4371
Modules: introduce the __module_private__ declaration specifier, which
...
indicates that a declaration is only visible within the module it is
declared in.
llvm-svn: 139348
2011-09-09 02:06:17 +00:00
Richard Trieu
2bd0401b04
Change all references of type ExprTy to Expr and get rid of the typedefs.
...
llvm-svn: 139347
2011-09-09 02:00:50 +00:00
Caitlin Sadowski
990d571226
Thread safety: added support for function scopes in attribute arguments.
...
This patch was written by DeLesley Hutchins.
llvm-svn: 139302
2011-09-08 17:42:31 +00:00
Caitlin Sadowski
9385dd7415
Thread Safety: Patch to implement delayed parsing of attributes within a
...
class scope.
This patch was also written by DeLesley Hutchins.
llvm-svn: 139301
2011-09-08 17:42:22 +00:00
David Blaikie
d937bf13d4
Adding FixIts to static/inline main declaration diagnostics.
...
llvm-svn: 139282
2011-09-08 06:33:04 +00:00
Richard Trieu
aa5e256c20
Change the self-reference visitor (which gives the warning for self-reference oninitalization warning of -Wuninitialized) to exclude member variables that can decay into pointers. This will cause it to no longer warn on this code:
...
struct foo { char a[100], *e; } bar = { .e = bar.a };
llvm-svn: 139213
2011-09-07 00:58:53 +00:00
Douglas Gregor
49695f078e
Implement the Named Return Value Optimization (NRVO) for blocks.
...
llvm-svn: 139178
2011-09-06 20:46:03 +00:00
Douglas Gregor
e3f3ea08a8
Implement the Named Return Value Optimization (NRVO) for Objective-C++
...
methods. Fixes PR10835 / <rdar://problem/10050178>.
llvm-svn: 139175
2011-09-06 20:33:37 +00:00
Sebastian Redl
e9c4e84f8e
Add test case for defaulted copy and move structure validation.
...
Fix bug this uncovered.
Address minor comments from Doug.
Enable cxx_implicit_moves feature.
llvm-svn: 139101
2011-09-04 18:14:28 +00:00
Douglas Gregor
e8bbc12152
Extend the ASTContext constructor to delay the initialization of
...
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).
llvm-svn: 138985
2011-09-02 00:18:52 +00:00
Richard Trieu
a04ad1a1b9
Extend the self-reference warning to catch when a constructor references itself upon initialization, such as using itself within its own copy constructor.
...
struct S {};
S s(s);
llvm-svn: 138969
2011-09-01 21:44:13 +00:00
Fariborz Jahanian
97d744bea4
objective-c: this patch (re)introduces objective-c's default property
...
synthesis. This new feature is currently placed under
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon.
// rdar://8843851
llvm-svn: 138913
2011-08-31 22:24:06 +00:00
Fariborz Jahanian
4327b32654
Minor clean up of objc's decl context stuff.
...
No change in functionality.
llvm-svn: 138742
2011-08-29 17:33:12 +00:00
Nico Weber
1fb82667dd
Warn on missing [super finalize] calls.
...
This matches gcc's logic. Second half of PR10661.
llvm-svn: 138730
2011-08-28 22:35:17 +00:00
Douglas Gregor
081425343b
Introduce support for a simple module import declaration, which
...
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
- Module imports are handled first by the preprocessor (to get macro
definitions) and then the same tokens are also handled by the parser
(to get declarations). If both happen (as in normal compilation),
the second one is redundant, because we currently have no way to
hide macros or declarations when loading a module. Chris gets credit
for this mad-but-workable scheme.
- The Preprocessor now holds on to a reference to a module loader,
which is responsible for loading named modules. CompilerInstance is
the only important module loader: it now knows how to create and
wire up an AST reader on demand to actually perform the module load.
- We search for modules in the include path, using the module name
with the suffix ".pcm" (precompiled module) for the file name. This
is a temporary hack; we hope to improve the situation in the
future.
llvm-svn: 138679
2011-08-26 23:56:07 +00:00
Eli Friedman
3fa64df543
Refactor and fix checking for initialization of flexible array members. The old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks.
...
Fixes PR10648 and another similar accepts-invalid bug.
llvm-svn: 138398
2011-08-23 22:24:57 +00:00
Matt Beaumont-Gay
56381b8502
Fix an incorrect note.
...
For the test case added to function-redecl.cpp, we were previously complaining
about a mismatch in the parameter types, since the definition used the
typedef'd type.
llvm-svn: 138318
2011-08-23 01:35:51 +00:00
Nico Weber
715abaf213
Warn on missing [super dealloc] calls.
...
This matches gcc's logic. Half of PR10661.
llvm-svn: 138240
2011-08-22 17:25:57 +00:00
Fariborz Jahanian
8d382dc781
Restore patch I reversed in r138040. Known buildbot
...
failures are resolved.
llvm-svn: 138234
2011-08-22 15:54:49 +00:00
Fariborz Jahanian
9a3b269ea1
Revers r138040. Need to look at a few buildbot failures.
...
llvm-svn: 138049
2011-08-19 18:02:47 +00:00
Fariborz Jahanian
d6d866d6fa
objective-c: Bring objective-c handling of decl context
...
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.
llvm-svn: 138040
2011-08-19 16:06:57 +00:00
Chandler Carruth
e92e42f3fd
Fix the rest of the indent goofiness here.
...
llvm-svn: 138024
2011-08-19 01:40:11 +00:00
Chandler Carruth
f8b554f0f2
Fix an egregious formatting goof.
...
llvm-svn: 138023
2011-08-19 01:38:33 +00:00
Kaelyn Uhrain
40aa7c91b6
Don't accept a typo correction if the corrected identifier is the same as the
...
uncorrected identifier. Fixes a problem pointed out by Eli.
llvm-svn: 137987
2011-08-18 21:57:36 +00:00
Kaelyn Uhrain
fd81a350e2
Rework DiagnoseInvalidRedeclaration to add the ability to correct typos when
...
diagnosing invalid function redeclarations.
llvm-svn: 137966
2011-08-18 18:19:12 +00:00
Richard Smith
a77a0a6bf2
Track in the AST whether a function is constexpr.
...
llvm-svn: 137653
2011-08-15 21:04:07 +00:00