aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaExceptionSpec.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-06-11Implement support for C++11 in-class initialization of non-static data members.Richard Smith1-4/+6
llvm-svn: 132878
2011-05-24MSVC doesn't do any validation regarding exception specification.Francois Pichet1-1/+4
llvm-svn: 131950
2011-05-20Fix PR9941 for out-of-line template destructors too.Sebastian Redl1-7/+12
llvm-svn: 131722
2011-05-19Reapply r121528, fixing PR9941 by delaying the exception specification check ↵Sebastian Redl1-0/+8
for destructors until the class is complete and destructors have been adjusted. llvm-svn: 131632
2011-04-22For consistency, change suffix from war_ to warn_ for some Microsoft ↵Francois Pichet1-2/+2
warnings I introduced lately. llvm-svn: 129986
2011-03-19Downgrade err_mismatched_exception_spec to a ExtWarning in Microsoft mode. ↵Francois Pichet1-11/+10
MSVC doesn't do any validation on exception specifications. This remove 1 error when parsing MSVC stl lib with clang. llvm-svn: 127961
2011-03-15More robust check for the special C++0x operator new workaround.Sebastian Redl1-5/+5
llvm-svn: 127692
2011-03-15Implement a hack to work around the changing exception specification of ↵Sebastian Redl1-2/+38
operator new in C++0x. llvm-svn: 127688
2011-03-13Instead of storing an ASTContext* in FunctionProtoTypes with computed ↵Sebastian Redl1-4/+4
noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall. llvm-svn: 127568
2011-03-12Propagate the new exception information to FunctionProtoType.Sebastian Redl1-45/+200
Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
2011-03-12Forgotten part of previous commit.Abramo Bagnara1-4/+4
llvm-svn: 127536
2011-03-06Reinstate r127112, "Propagate new-style exception spec information to ↵Sebastian Redl1-4/+4
ExtProtoInfo.", this time with the missing header. llvm-svn: 127118
2011-03-06Revert r127112, "Propagate new-style exception spec information to ↵NAKAMURA Takumi1-4/+4
ExtProtoInfo." It seems missing "clang/Basic/ExceptionSpecificationType.h". llvm-svn: 127115
2011-03-05Propagate new-style exception spec information to ExtProtoInfo.Sebastian Redl1-4/+4
llvm-svn: 127112
2011-03-02Semantic checking for exception specifications should be triggered byJohn McCall1-3/+3
whether C++ exceptions are enabled, not exceptions in general. PR9358. llvm-svn: 126820
2010-12-14Added missing IgnoreParens().Abramo Bagnara1-3/+1
llvm-svn: 121795
2010-12-14Restore r121752 without modification.John McCall1-18/+17
llvm-svn: 121763
2010-12-14Pull out r121752 in case it's causing the selfhost breakage.John McCall1-17/+18
llvm-svn: 121759
2010-12-14Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall1-18/+17
class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
2010-12-10Added ParenType type node.Abramo Bagnara1-0/+2
llvm-svn: 121488
2010-08-30Emulate (some of) Microsoft's looser semantic checking of exceptionDouglas Gregor1-0/+8
specifications, from Martin Vejnar! llvm-svn: 112482
2010-08-25Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall1-1/+1
Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
2010-08-12Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor1-1/+1
llvm-svn: 110945
2010-05-28Disable exception-spec compatibility checking under -fno-exceptions.John McCall1-0/+9
Fixes PR7243. llvm-svn: 104942
2010-05-21Use CanQualType to enforce the use of a canonical type argument toDouglas Gregor1-1/+1
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a canonical type. Fixes PR7176. llvm-svn: 104374
2010-03-31Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor1-2/+1
the C-only "optimization". llvm-svn: 100022
2010-03-31Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor1-1/+2
llvm-svn: 100018
2010-03-31Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor1-2/+1
term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
2010-03-30the big refactoring bits of PR3782.Rafael Espindola1-4/+2
This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
2010-03-29Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor1-10/+14
cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. llvm-svn: 99849
2010-03-24When a declaration of a function is missing an exception specificationDouglas Gregor1-14/+115
that was present in a prior declaration, emit a warning rather than a hard error (which we did before, and still do with mismatched exception specifications). Moreover, provide a fix-it hint with the throw() clause that should be added, e.g., t.C:10:7: warning: 'operator new' is missing exception specification 'throw(std::bad_alloc)' void *operator new(unsigned long sz) ^ throw(std::bad_alloc) As part of this, disable the warning when we're missing an exception specification on operator new, operator new[], operator delete, or operator delete[] when exceptions are turned off (-fno-exceptions). Fixes PR5957. llvm-svn: 99388
2010-03-16Perform access control for the implicit base and member destructor callsJohn McCall1-3/+3
required when emitting a destructor definition. llvm-svn: 98609
2010-02-12Work around an annoying, non-standard optimization in the glibcDouglas Gregor1-2/+63
headers, where malloc (and many other libc functions) are declared with empty throw specifications, e.g., extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__ ((__malloc__)) ; The C++ standard doesn't seem to allow this, and redeclaring malloc as the standard permits (as follows) resulted in Clang (rightfully!) complaining about mis-matched exception specifications. void *malloc(size_t size); We work around this by silently propagating an empty throw specification "throw()" from a function with C linkage declared in a system header to a redeclaration that has no throw specifier. Ick. llvm-svn: 95969
2010-02-10Improve access control diagnostics. Perform access control on member-pointerJohn McCall1-2/+16
conversions. Fix an access-control bug where privileges were not considered at intermediate points along the inheritance path. Prepare for friends. llvm-svn: 95775
2009-12-10Implement C++ DR437, which involves exception-specifications that nameDouglas Gregor1-4/+13
a type currently being defined, from Nicola Gigante! llvm-svn: 91052
2009-11-16First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor1-2/+2
sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
2009-10-14Have the exception specification checkers take partial diagnostics. Use this ↵Sebastian Redl1-11/+14
to merge two diagnostics. llvm-svn: 84105
2009-10-14Use CanQualType in the exception specification verification type sets.Sebastian Redl1-3/+3
llvm-svn: 84101
2009-10-14Use partial diagnostics properly in call to RequireCompleteType. Among other ↵Sebastian Redl1-8/+6
things, this means we get a note on the declaration of the incomplete type when it is used in an exception specification. llvm-svn: 84099
2009-10-14Do exception spec compatibility tests for member pointers, too.Sebastian Redl1-0/+5
llvm-svn: 84098
2009-10-11Types appearing more than once in a spec shouldn't matter.Sebastian Redl1-5/+10
llvm-svn: 83766
2009-10-11Test exception spec compatibility on return type and parameters.Sebastian Redl1-0/+309
Along the way, use RequireCompleteType when testing exception spec types. Separate all the ugly spec stuff into its own file. llvm-svn: 83764