summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark the ExtWarn for in-class initialization of static const float members ↵Richard Smith2011-09-291-7/+8
| | | | | | as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. llvm-svn: 140820
* In C++0x, static const volatile data members cannot be initialized in-class.Richard Smith2011-09-291-4/+5
| | | | llvm-svn: 140809
* constexpr: semantic checking for constexpr variables.Richard Smith2011-09-291-24/+95
| | | | | | 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
* Revert r140589. It was causing failures during llvm compilation:Bill Wendling2011-09-271-47/+1
| | | | | | | | | | | | | | 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
* Add typo correction for the type name in C++ "new" statementsKaelyn Uhrain2011-09-271-1/+47
| | | | llvm-svn: 140589
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-3/+3
| | | | llvm-svn: 140478
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-3/+1
| | | | llvm-svn: 140407
* Don't propagate the 'availability' attribute through declarationDouglas Gregor2011-09-231-2/+4
| | | | | | | | 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
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+6
| | | | llvm-svn: 140367
* ArrayRef-ifying the fields passed to Sema::ActOnFieldsDavid Blaikie2011-09-221-8/+9
| | | | llvm-svn: 140293
* ArrayRef-ifying Function/BlockDecl's setParamsDavid Blaikie2011-09-211-3/+3
| | | | llvm-svn: 140268
* [microsoft] Move missing typename warning from -fms-extensions to ↵Francois Pichet2011-09-211-2/+2
| | | | | | -fms-compatibility. Also allow the missing typename warning at function scope. llvm-svn: 140240
* Remove redundant break statements, and replace asserts with llvm_unreachablePeter Collingbourne2011-09-201-2/+1
| | | | | | Per John's review comments for r140068. llvm-svn: 140142
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-191-0/+19
| | | | llvm-svn: 140068
* Fix PR10531. Attach an initializer to anonymous unions, since the default ↵Richard Smith2011-09-181-0/+6
| | | | | | constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted. llvm-svn: 139991
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-17/+18
| | | | | | | | 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
* Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclarationKaelyn Uhrain2011-09-141-2/+7
| | | | llvm-svn: 139718
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-2/+2
| | | | | | | | | | 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
* Kill off an irrelevant FIXMEDouglas Gregor2011-09-121-4/+1
| | | | llvm-svn: 139523
* Diagnose attempt to mark function-local declarations as __module_private__.Douglas Gregor2011-09-121-7/+35
| | | | llvm-svn: 139519
* Allow __module_private__ on fieldsDouglas Gregor2011-09-121-0/+6
| | | | llvm-svn: 139499
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+6
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Specializations cannot be module-hidden. Diagnose attempts to do so.Douglas Gregor2011-09-091-6/+24
| | | | llvm-svn: 139406
* __module_private__ is inherited by redeclarations of an entity, andDouglas Gregor2011-09-091-7/+31
| | | | | | must also be present of the first declaration of that entity. llvm-svn: 139384
* Propagate __module_private__ from previous declarations to laterDouglas Gregor2011-09-091-1/+19
| | | | | | declarations. llvm-svn: 139380
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-0/+17
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* Change all references of type ExprTy to Expr and get rid of the typedefs.Richard Trieu2011-09-091-3/+3
| | | | llvm-svn: 139347
* Thread safety: added support for function scopes in attribute arguments.Caitlin Sadowski2011-09-081-0/+23
| | | | | | This patch was written by DeLesley Hutchins. llvm-svn: 139302
* Thread Safety: Patch to implement delayed parsing of attributes within aCaitlin Sadowski2011-09-081-0/+9
| | | | | | | | class scope. This patch was also written by DeLesley Hutchins. llvm-svn: 139301
* Adding FixIts to static/inline main declaration diagnostics.David Blaikie2011-09-081-35/+36
| | | | llvm-svn: 139282
* Change the self-reference visitor (which gives the warning for ↵Richard Trieu2011-09-071-0/+1
| | | | | | | | 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
* Implement the Named Return Value Optimization (NRVO) for blocks.Douglas Gregor2011-09-061-3/+3
| | | | llvm-svn: 139178
* Implement the Named Return Value Optimization (NRVO) for Objective-C++Douglas Gregor2011-09-061-0/+3
| | | | | | methods. Fixes PR10835 / <rdar://problem/10050178>. llvm-svn: 139175
* Add test case for defaulted copy and move structure validation.Sebastian Redl2011-09-041-0/+2
| | | | | | | | Fix bug this uncovered. Address minor comments from Doug. Enable cxx_implicit_moves feature. llvm-svn: 139101
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-11/+11
| | | | | | | | 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
* Extend the self-reference warning to catch when a constructor references ↵Richard Trieu2011-09-011-13/+60
| | | | | | | | | itself upon initialization, such as using itself within its own copy constructor. struct S {}; S s(s); llvm-svn: 138969
* objective-c: this patch (re)introduces objective-c's default propertyFariborz Jahanian2011-08-311-18/+0
| | | | | | | | | | 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
* Minor clean up of objc's decl context stuff.Fariborz Jahanian2011-08-291-1/+1
| | | | | | No change in functionality. llvm-svn: 138742
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+6
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* Introduce support for a simple module import declaration, whichDouglas Gregor2011-08-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | 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
* Refactor and fix checking for initialization of flexible array members. The ↵Eli Friedman2011-08-231-21/+0
| | | | | | | | 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
* Fix an incorrect note.Matt Beaumont-Gay2011-08-231-1/+1
| | | | | | | | 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
* Warn on missing [super dealloc] calls.Nico Weber2011-08-221-0/+7
| | | | | | This matches gcc's logic. Half of PR10661. llvm-svn: 138240
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-11/+23
| | | | | | failures are resolved. llvm-svn: 138234
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-191-23/+11
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-191-11/+23
| | | | | | | | | | 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
* Fix the rest of the indent goofiness here.Chandler Carruth2011-08-191-3/+3
| | | | llvm-svn: 138024
* Fix an egregious formatting goof.Chandler Carruth2011-08-191-19/+19
| | | | llvm-svn: 138023
* Don't accept a typo correction if the corrected identifier is the same as theKaelyn Uhrain2011-08-181-1/+2
| | | | | | uncorrected identifier. Fixes a problem pointed out by Eli. llvm-svn: 137987
* Rework DiagnoseInvalidRedeclaration to add the ability to correct typos whenKaelyn Uhrain2011-08-181-23/+69
| | | | | | diagnosing invalid function redeclarations. llvm-svn: 137966
OpenPOWER on IntegriCloud