summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Attach class template attributes to the templated CXXRecordDecl,Peter Collingbourne2011-10-231-1/+4
| | | | | | | | | instead of silently discarding them. As a side effect, this improves diagnostics for constexpr class templates slightly. llvm-svn: 142755
* objective-c: Diagnose redeclaration of privateFariborz Jahanian2011-10-211-0/+22
| | | | | | ivars in class extensions. // rdar://10309454 llvm-svn: 142664
* When performing name lookup for the previous declaration of a field,Douglas Gregor2011-10-211-8/+17
| | | | | | | | be sure to consider all of the possible lookup results. We were assert()'ing (but behaving correctly) for unresolved values. Fixes PR11134 / <rdar://problem/10290422>. llvm-svn: 142652
* Permit auto SCS on parameter declarations, C++03 [dcl.stc]p2Peter Collingbourne2011-10-211-0/+5
| | | | llvm-svn: 142649
* Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-PODRichard Smith2011-10-201-5/+5
| | | | | | | | but trivially constructible and destructible variables in C++11 mode. Also incidentally improve the precision of the wording for jump diagnostics in C++98 mode. llvm-svn: 142619
* When fixing up the storage class for an anonymous union, don't markDouglas Gregor2011-10-201-2/+0
| | | | | | the anonymous union as valid: our fixes have Fix-Its. llvm-svn: 142616
* There's no point in marking a declaration invalid just because itDouglas Gregor2011-10-201-3/+2
| | | | | | | | shadows a template parameter. Complain about the shadowing (or not, under -fms-extensions), but don't invalidate the declaration. Merely forget about the template parameter declaration. llvm-svn: 142596
* FixIt insert 'static' for anonymous unions at global or namespace scope.David Blaikie2011-10-201-1/+2
| | | | llvm-svn: 142566
* Add a fixit to remove storage specifiers on anonymous enums.David Blaikie2011-10-201-1/+2
| | | | llvm-svn: 142565
* 80 cols (one I created in my last commit, plus a bunch of others that were ↵David Blaikie2011-10-191-24/+39
| | | | | | already there) llvm-svn: 142552
* Don't provide errors for anonymous unions when they're actually anonymous ↵David Blaikie2011-10-191-26/+28
| | | | | | classes. llvm-svn: 142551
* -Wc++98-compat: warn on nontrivial types used in unions and anonymous structs.Richard Smith2011-10-191-7/+10
| | | | llvm-svn: 142541
* Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!Douglas Gregor2011-10-191-0/+1
| | | | llvm-svn: 142478
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-2/+3
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Under ARC, merge the bit corresponding to the ns_returns_retainedDouglas Gregor2011-10-141-0/+12
| | | | | | | attribute from the first declaration to later declarations. Fixes <rdar://problem/10142572>. llvm-svn: 141957
* When declaring an out-of-line template, attempt to rebuild any typesDouglas Gregor2011-10-141-0/+10
| | | | | | | within the template parameter list that may have changed now that we know the current instantiation. Fixes <rdar://problem/10194295>. llvm-svn: 141954
* Add returns_twice to functions that are known to return twice. This implementsRafael Espindola2011-10-121-0/+3
| | | | | | the same behavior of gcc by keeping the attribute out of the function type. llvm-svn: 141803
* [Microsoft] If -fms-compatibility, then downgrade missing typename error to ↵Francois Pichet2011-10-111-3/+4
| | | | | | warning at function prototype scope. llvm-svn: 141630
* Add typo correction for type names.Kaelyn Uhrain2011-10-111-1/+47
| | | | | | | | 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
* Clean up DiagnoseInvalidRedeclaration a bitKaelyn Uhrain2011-10-111-26/+31
| | | | llvm-svn: 141612
* Move a couple chunks of ActOnFunctionDeclarator to separate functionsKaelyn Uhrain2011-10-111-186/+202
| | | | llvm-svn: 141611
* Move some bool flags out of function parameter lists.Kaelyn Uhrain2011-10-111-74/+86
| | | | llvm-svn: 141610
* Only accept a typo correction if it doesn't trigger additional errorsKaelyn Uhrain2011-10-111-30/+101
| | | | llvm-svn: 141609
* Constant expression evaluation refactoring:Richard Smith2011-10-101-5/+1
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Give nicer note when a member redeclaration has or lacks 'const'Kaelyn Uhrain2011-10-101-1/+11
| | | | llvm-svn: 141555
* Push "out-of-line" declarations into scope when their lexical/semanticDouglas Gregor2011-10-091-1/+3
| | | | | | | redeclaration contexts are the same, as occurs within linkage specifications. Fixes PR9162. llvm-svn: 141521
* A friend template specialization is also dependent if any of itsDouglas Gregor2011-10-091-1/+5
| | | | | | template arguments are dependent. Fixes PR10913. llvm-svn: 141515
* Diagnose attempts to declare a non-static data member with aDouglas Gregor2011-10-091-1/+1
| | | | | | non-identifier name. Fixes PR10839. llvm-svn: 141513
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-2/+2
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Implicitly assume that a ObjC category to an unavailable interface is also ↵Argyrios Kyrtzidis2011-10-061-0/+9
| | | | | | | | unavailable; only give an 'unavailable' error on the @implementation of the category. rdar://10234078 llvm-svn: 141335
* When using an unavailable/deprecated interface Foo inside Foo's ↵Argyrios Kyrtzidis2011-10-061-2/+13
| | | | | | | | interface/implementation don't emit unavailable errors. llvm-svn: 141334
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-1/+2
| | | | | | | | 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
* PR11067: A definition of a constexpr static variable doesn't need an ↵Richard Smith2011-10-061-9/+6
| | | | | | initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression. llvm-svn: 141279
* OpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,Peter Collingbourne2011-10-061-4/+4
| | | | | | | | | 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
* objc arc: Suppress certain arc diagnostics on unavailableFariborz Jahanian2011-10-031-2/+4
| | | | | | functions. // rdar://10186536 llvm-svn: 141037
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-1/+2
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* constexpr: semantic checking for constexpr functions and constructors. Based inRichard Smith2011-10-011-5/+9
| | | | | | | | | | | | | part on patches by Peter Collingbourne. We diverge from the C++11 standard in a few areas, mostly related to checking constexpr function declarations, and not just definitions. See WG21 paper N3308=11-0078 for details. Function invocation substitution is not available in this patch; constexpr functions cannot yet be used from within constant expressions. llvm-svn: 140926
* Mark a TagDecl when it is free standing (e.g. "struct foo;")Argyrios Kyrtzidis2011-09-301-0/+3
| | | | llvm-svn: 140894
* Add explicit attributes to mark functions as having had theirJohn McCall2011-09-301-0/+4
| | | | | | | | | | | CoreFoundation object-transfer properties audited, and add a #pragma to cause them to be automatically applied to functions in a particular span of code. This has to be implemented largely in the preprocessor because of the requirement that the region be entirely contained in a single file; that's hard to impose from the parser without registering for a ton of callbacks. llvm-svn: 140846
* Suggest adding 'constexpr' if the GNU extension for in-class initializers ↵Richard Smith2011-09-301-0/+4
| | | | | | for static const float members is used in C++11 mode. llvm-svn: 140828
* 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
OpenPOWER on IntegriCloud