summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Partially revert r186903.Eli Friedman2013-07-261-1/+1
| | | | | | | | It turns out that Plum Hall depends on us not emitting an error on integer literals which fit into long long, but fit into unsigned long long. So C99 conformance requires not conforming to C99. :) llvm-svn: 187172
* When we perform dependent name lookup during template instantiation, it's notRichard Smith2013-07-254-39/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sufficient to only consider names visible at the point of instantiation, because that may not include names that were visible when the template was defined. More generally, if the instantiation backtrace goes through a module M, then every declaration visible within M should be available to the instantiation. Any of those declarations might be part of the interface that M intended to export to a template that it instantiates. The fix here has two parts: 1) If we find a non-visible declaration during name lookup during template instantiation, check whether the declaration was visible from the defining module of all entities on the active template instantiation stack. The defining module is not the owning module in all cases: we look at the module in which a template was defined, not the module in which it was first instantiated. 2) Perform pending instantiations at the end of a module, not at the end of the translation unit. This is general goodness, since it significantly cuts down the amount of redundant work that is performed in every TU importing a module, and also implicitly adds the module containing the point of instantiation to the set of modules checked for declarations in a lookup within a template instantiation. There's a known issue here with template instantiations performed while building a module, if additional imports are added later on. I'll fix that in a subsequent commit. llvm-svn: 187167
* Remove the mblaze backend from clang.Rafael Espindola2013-07-251-53/+0
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187143
* Sema: Minor const fixups and control flow tidying.Benjamin Kramer2013-07-242-97/+71
| | | | | | No functionality change. llvm-svn: 187047
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-233-40/+78
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Going back to using getName for consistency.Aaron Ballman2013-07-231-7/+2
| | | | llvm-svn: 186966
* Replacing some manual diagnostic checks with an existing helper method. ↵Aaron Ballman2013-07-231-12/+3
| | | | | | Adding missing test cases for the diagnostics. llvm-svn: 186944
* Removed a redundant diagnostic and replaced it with a more standard one. ↵Aaron Ballman2013-07-231-2/+2
| | | | | | Added a test case for the diagnostic. llvm-svn: 186942
* Consolidate several attribute argument diagnostics into a single, selectable ↵Aaron Ballman2013-07-232-48/+72
| | | | | | diagnostic. This makes the diagnostic more consistent. llvm-svn: 186940
* Correcting the NSObject and Overloadable attribute diagnostics so that the ↵Aaron Ballman2013-07-231-6/+2
| | | | | | count reported matches reality. llvm-svn: 186936
* C++1y literal suffix support:Richard Smith2013-07-231-1/+3
| | | | | | | * Allow ns, us, ms, s, min, h as numeric ud-suffixes * Allow s as string ud-suffix llvm-svn: 186933
* Error on more illegal kernel argument types for OpenCLMatt Arsenault2013-07-231-18/+170
| | | | | | | | bool, half, pointers and structs / unions containing any of these are not allowed. Does not yet reject size_t and related integer types that are also disallowed. llvm-svn: 186908
* Integers which are too large should be an error.Eli Friedman2013-07-231-4/+4
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Don't emit open-paren fixit without close-paren.Eli Friedman2013-07-221-0/+4
| | | | | | | | | | getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure we do something sane. Fixes PR16673. I'm not sure how to write a testcase for this short of grepping through the diagnostic output. llvm-svn: 186889
* Fixed implementation of C89 6.5.7 p3.Enea Zaffanella2013-07-221-0/+1
| | | | | | Warning should be emitted only for InitListExpr nodes. llvm-svn: 186859
* Update comment to refer to core issue number.Richard Smith2013-07-221-4/+2
| | | | llvm-svn: 186848
* Implement the part of C89 6.5.7 p3 requiring a constant initializer listEnea Zaffanella2013-07-221-3/+13
| | | | | | when initializing aggregate/union types, no matter if static or not. llvm-svn: 186817
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-223-25/+27
| | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename llvm-svn: 186816
* Remove superfluous cast.Robert Wilhelm2013-07-221-2/+1
| | | | llvm-svn: 186807
* PR16288: A template is only missing a default template argument if it providesRichard Smith2013-07-221-4/+1
| | | | | | any default template arguments, not if it inherits some. llvm-svn: 186804
* Implement DR257 / fix PR16659:Richard Smith2013-07-221-7/+36
| | | | | | | | | | | | | | | A constructor for an abstract class does not call constructors for virtual base classes, so it is not an error if no initializer is present for the virtual base and the virtual base cannot be default initialized. Also provide a (disabled by default, for now) warning for the case where a virtual base class's initializer is ignored in an abstract class's constructor, and address a defect in DR257 where it was not carried through to C++11's rules for implicit deletion of special member functions. Based on a patch by Maurice Bos. llvm-svn: 186803
* SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. ↵NAKAMURA Takumi2013-07-221-2/+0
| | | | | | [-Wdocumentation] llvm-svn: 186802
* Convert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.Robert Wilhelm2013-07-213-70/+43
| | | | llvm-svn: 186794
* Add missing check for creating an instance of an abstract class through anRichard Smith2013-07-201-1/+5
| | | | | | implicit conversion sequence. llvm-svn: 186769
* add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)Lubos Lunak2013-07-202-2/+16
| | | | | | | | | The functionality is equivalent to the GCC attribute. Variables of tagged types will be warned about as unused if they are not used in any way except for possible (even non-trivial) ctors/dtors called. Useful for tagging classes like std::string (which is not part of this commit). llvm-svn: 186765
* Make IgnoreParens() look through ChooseExprs.Eli Friedman2013-07-203-3/+24
| | | | | | | | | | | | | This is the same way GenericSelectionExpr works, and it's generally a more consistent approach. A large part of this patch is devoted to caching the value of the condition of a ChooseExpr; it's needed to avoid threading an ASTContext into IgnoreParens(). Fixes <rdar://problem/14438917>. llvm-svn: 186738
* FIXME fix: improving diagnostics for template arguments deduction of class ↵Larisse Voufo2013-07-195-147/+302
| | | | | | | | templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info. llvm-svn: 186730
* Revert "Use function overloading instead of template specialization for ↵Larisse Voufo2013-07-194-302/+143
| | | | | | | | diagnosis of bad template argument deductions." This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95. llvm-svn: 186729
* Fix pack instantiation with function types.Eli Friedman2013-07-191-0/+4
| | | | | | | Make sure we correctly expand packs which expand to another pack in a function type. llvm-svn: 186728
* Use function overloading instead of template specialization for diagnosis of ↵Larisse Voufo2013-07-194-143/+302
| | | | | | bad template argument deductions. llvm-svn: 186727
* Correctly handle packs for variadic type traits.Eli Friedman2013-07-191-0/+13
| | | | | | | | | | | | | | | I'm not sure how to write a test for this; the following shows the difference in -ast-dump: template <int x> struct A {}; template <class T> struct B { }; template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>; template <class ...Args> using D = C<B<Args>...>; However, I can't seem to write a test that triggers a visible difference in behavior. llvm-svn: 186726
* Create calling convention AttributedType sugar nodesReid Kleckner2013-07-191-7/+38
| | | | | | | | | | | | Canonical types are unchanged. The type printer had to be changed to avoid printing any non-default implicit calling convention as well as the calling convention attribute. Reviewers: rjmccall Differential Revision: http://llvm-reviews.chandlerc.com/D1132 llvm-svn: 186714
* Fix for template substitution with packs.Eli Friedman2013-07-191-38/+27
| | | | | | | | | | When we see a pack, and replace it with a template argument which is also a pack, we want to use the pack pattern, not the expanded pack. The caller should take care of expanding the pack afterwards. Fixes PR16646. llvm-svn: 186713
* Replace some existing type attribute diagnostics with aAaron Ballman2013-07-191-17/+16
| | | | | | single diagnostic that selects. No functional changes intended. llvm-svn: 186708
* Fix source range of implicitly instantiated friend declaration.Enea Zaffanella2013-07-191-0/+1
| | | | llvm-svn: 186702
* Remove trailing whitespace.Craig Topper2013-07-191-5/+4
| | | | llvm-svn: 186652
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-193-1/+366
| | | | llvm-svn: 186647
* Clean up diagnostics for inheriting constructors.Eli Friedman2013-07-182-6/+21
| | | | | | | No new diagnostics, just better wording and notes pointing at more relevant locations. llvm-svn: 186629
* Switching to use checkAttributeNumArgs for trivial cases. No functional ↵Aaron Ballman2013-07-181-10/+4
| | | | | | changes intended. llvm-svn: 186591
* Replacing a morally duplicate diagnostic by adding it to an existing ↵Aaron Ballman2013-07-181-3/+6
| | | | | | diagnostic's select list. Updates the tests for the more consistent diagnostic. llvm-svn: 186584
* Removed a parameter from handleAttrWithMessage to make it more consistent ↵Aaron Ballman2013-07-181-5/+5
| | | | | | with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case. llvm-svn: 186578
* Reinstate r186040, with additional fixes and more test coverage (reverted inRichard Smith2013-07-174-25/+22
| | | | | | | | | | | | | r186331). Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186546
* Even more code conformance.Robert Wilhelm2013-07-171-1/+1
| | | | llvm-svn: 186537
* MS wide bitfield error check in SemaReid Kleckner2013-07-171-5/+7
| | | | | | | | | | | | | cl.exe treats wide bitfields as an error. This patch causes them to be an error if IsMsStruct is true, as it is in straight C. Patch by Warren Hunt! Reviewers: eli.friedman Differential Revision: http://llvm-reviews.chandlerc.com/D1125 llvm-svn: 186536
* Improve idiomatic-parentheses by checking method family instead of relying ↵Jean-Daniel Dupas2013-07-171-1/+1
| | | | | | on the selector name. llvm-svn: 186524
* SemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.NAKAMURA Takumi2013-07-171-1/+1
| | | | llvm-svn: 186523
* Fixed source range of C++03 access declarations.Enea Zaffanella2013-07-171-6/+1
| | | | llvm-svn: 186522
* More code conformance.Fariborz Jahanian2013-07-171-1/+1
| | | | llvm-svn: 186474
* Make Expr::isConstantInitializer match IRGen.Eli Friedman2013-07-162-5/+11
| | | | | | | | | | Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. llvm-svn: 186464
* This patch removes unused parameter allProperties and converts remainingFariborz Jahanian2013-07-161-10/+6
| | | | | | | parameters in ArrayRef'ize Sema::ActOnAtEnd to ArrayRef. Patch by Robert Wilhelm. llvm-svn: 186421
OpenPOWER on IntegriCloud