Commit Graph

1138 Commits

Author SHA1 Message Date
Sebastian Redl b469afb4f3 Implement __has_virtual_destructor. Patch by Steven Watanabe.
llvm-svn: 112905
2010-09-02 23:19:42 +00:00
Dawn Perchik f0882f90f3 Reverting rev 112791 - apparently -fborland-extensions is on all the time?!
llvm-svn: 112797
2010-09-02 02:18:55 +00:00
Ted Kremenek cbe6b0b846 Enhance return-stack-address check (in Sema) to handle fields that themselves are references. (Fixes PR 7999; fix by Chandler Carruth).
llvm-svn: 112792
2010-09-02 01:12:13 +00:00
Dawn Perchik 1fcc18c7bc Add support for Borland extensions via option -fborland-extensions
llvm-svn: 112791
2010-09-02 01:12:01 +00:00
Douglas Gregor eece0eaa85 Transfer calling-convention attributes down to member function pointers.
llvm-svn: 112715
2010-09-01 16:29:03 +00:00
Sebastian Redl 7dcb155c18 Implement the __has_nothrow trait family, by Steven Watanabe.
llvm-svn: 112577
2010-08-31 04:59:00 +00:00
Alexis Hunt 3b7918625c Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

llvm-svn: 112493
2010-08-30 17:47:05 +00:00
Douglas Gregor f62c5294c1 Emulate (some of) Microsoft's looser semantic checking of exception
specifications, from Martin Vejnar!

llvm-svn: 112482
2010-08-30 15:04:51 +00:00
Douglas Gregor 2b1bbecb6b Predeclare class type_info in Microsoft mode, from Francois Pichet!
llvm-svn: 112478
2010-08-30 14:44:26 +00:00
Alexis Hunt 79eb5469e0 Implement C++0x user-defined string literals.
The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

llvm-svn: 112458
2010-08-29 21:26:48 +00:00
Ted Kremenek d7478d6010 Update test case, with comment to later investigate the correct behavior. Now the behavior is at least consistent.
llvm-svn: 112335
2010-08-28 00:19:12 +00:00
Ted Kremenek 82bfc86792 Explicitly handle CXXExprWithTemporaries during CFG construction by just visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130.
llvm-svn: 112334
2010-08-28 00:19:02 +00:00
Douglas Gregor 7bddb3cac3 Improve wording of diagnostic complaining about a non-void* pointer as the first parameter of operator delete
llvm-svn: 112298
2010-08-27 21:39:15 +00:00
John McCall 1ababa63de Continue to instantiate sub-statements in a CompoundStmt as long as
we don't see a DeclStmt (failure to instantiate which generally causes
panic).

llvm-svn: 112282
2010-08-27 19:56:05 +00:00
John McCall 8d08b9b408 Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.

Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.

Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a        
permitted form of use for member functions.

Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.

llvm-svn: 112258
2010-08-27 09:08:28 +00:00
Eric Christopher a613f56559 With lax vector conversions (the default) make sure we convert between two
vectors that are the same size. Fix up testcases accordingly and add a new one
to make sure we still error if lax vector conversions are disabled.

Fixes rdar://8328190

llvm-svn: 112122
2010-08-26 00:42:16 +00:00
Fariborz Jahanian f4677b201e Move the test for radar 8018252 to
SemaCXX/expressions.cpp.

llvm-svn: 111988
2010-08-24 22:55:33 +00:00
Fariborz Jahanian e0fd5a9299 It is not error in c++ to take address of
register variable (c++03 7.1.1P3). radar 8108252.

llvm-svn: 111977
2010-08-24 22:21:48 +00:00
Douglas Gregor 117db7e95a Parse all kinds of declarations as part of a linkage-specification,
from Francois Pichet! Fixes PR7754. 

llvm-svn: 111912
2010-08-24 14:14:45 +00:00
Eli Friedman 7fd5544bc9 PR7971: Compute the correct type for an address-of expression containing an
UnresolvedMemberExpr.

llvm-svn: 111899
2010-08-24 05:23:20 +00:00
Chandler Carruth c926240172 Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.

We add explicit code to the default initialization path to ensure the
definition is both present and valid.

Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.

llvm-svn: 111802
2010-08-23 07:55:51 +00:00
Douglas Gregor c0afc67608 We don't actually need to check the implicit object argument's
conversion a second time for a conversion candidate (with the real
acting context), because the only problems we would find are access or
ambiguity issues that won't be diagnosed until we pick this
candidate. Add a test case to prove it to myself.

llvm-svn: 111526
2010-08-19 17:02:01 +00:00
Douglas Gregor c9ed4681a8 Properly implement the part of C++ [over.match.funcs]p4 that treats
conversion functions as if their acting context were the class that
we're converting from (the implicit object argument's
type). Retroactively tweaking the implicit conversion sequence, as we
were trying to do before, breaks the invariants of that implicit
conversion sequence (e.g., the types and conversions don't match
up). Fixes <rdar://problem/8018274>.

llvm-svn: 111520
2010-08-19 15:57:50 +00:00
Eli Friedman 4202c34539 Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types.  An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.

This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?

llvm-svn: 111512
2010-08-19 04:39:37 +00:00
John McCall 5cf48cd17c On second thought, don't warn about reinterpret_casts under -Wcast-align.
llvm-svn: 111497
2010-08-19 01:19:08 +00:00
Ted Kremenek 50e0105f1c Add warning for functions/blocks that have attribute 'noreturn' but return a non-void result. (<rdar://problem/7562925>)
llvm-svn: 111492
2010-08-19 00:52:13 +00:00
Douglas Gregor fb640869ed There is no pointer conversion between to similar types (i.e., same
type ignoring cv-qualifiers). These are qualification
conversions. Fixes PR7934.

llvm-svn: 111428
2010-08-18 21:25:30 +00:00
John McCall 8f42893aff Flesh out the test cases a little.
llvm-svn: 111359
2010-08-18 09:58:15 +00:00
John McCall 02db245d5e Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class.  Also, look into templates when doing this.

llvm-svn: 111357
2010-08-18 09:41:07 +00:00
Argyrios Kyrtzidis beb71b315a Rename -Wunused-method -> -Wunused-member-function.
llvm-svn: 111305
2010-08-17 22:06:44 +00:00
Argyrios Kyrtzidis cad715fb9b Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.
This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.

llvm-svn: 111298
2010-08-17 21:43:11 +00:00
Douglas Gregor 175ea046ee A member function never has "C" linkage. Fixes <rdar://problem/8318976>.
llvm-svn: 111238
2010-08-17 16:09:23 +00:00
John McCall 3696dcb171 Don't try to initialize a reference with a constructed temporary if either
of the classes is invalid.  A class is invalid if a base is invalid.

llvm-svn: 111227
2010-08-17 07:23:57 +00:00
John McCall 2677e10732 A field of incomplete type is sufficiently disruptive that we should mark
the record invalid.

llvm-svn: 111211
2010-08-16 23:42:35 +00:00
Argyrios Kyrtzidis 33aee3934a Emit diagnostic error when the field of an anonymous struct is non trivial.
llvm-svn: 111158
2010-08-16 17:27:08 +00:00
Charles Davis ebab1ed5d3 Error out if reinterpret_casting between member pointers of two different
sizes.

llvm-svn: 111119
2010-08-16 05:30:44 +00:00
Charles Davis 2d3694297d Err on incomplete class types in member pointers when compiling for the
Microsoft C++ ABI, for now.

llvm-svn: 111118
2010-08-16 04:01:50 +00:00
Argyrios Kyrtzidis 04c7fa09e4 Don't warn for the common pattern of disallowing copying:
class S {
  S(const S&); // DO NOT IMPLEMENT
  void operator=(const S&); // DO NOT IMPLEMENT
};

llvm-svn: 111100
2010-08-15 10:17:33 +00:00
Argyrios Kyrtzidis 1b30d9c0f0 Commit improved version of 111026 & 111027.
Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

llvm-svn: 111086
2010-08-15 01:15:20 +00:00
Argyrios Kyrtzidis 98703d3883 Revert 111026 & 111027, build breakage.
llvm-svn: 111036
2010-08-13 20:13:06 +00:00
Argyrios Kyrtzidis 1063a71e43 The unused warnings extravaganza continues. Warn for:
-static variables
-variables in anonymous namespace (fixes rdar://7794535)
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

llvm-svn: 111027
2010-08-13 18:42:40 +00:00
Argyrios Kyrtzidis 540bc01f50 Expand the unused warnings for functions. Warn for:
-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

llvm-svn: 111026
2010-08-13 18:42:29 +00:00
John McCall b3732bb3b7 Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option.  The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable.  Platforms with less ornery linkers can feel free to enable this.

llvm-svn: 110979
2010-08-12 23:36:15 +00:00
John McCall 2b5c1b2516 Implement -Wcast-align. The initial design of this diagnostic diverges
from GCC's in that we warn on *any* increase in alignment requirements, not
just those that are enforced by hardware.  Please let us know if this causes
major problems for you (which it shouldn't, since it's an optional warning).

llvm-svn: 110959
2010-08-12 21:44:57 +00:00
John McCall 8246e350be Handle the obvious case for diagnosing redeclarations of extern "C" functions.
Fixes PR7859.

llvm-svn: 110906
2010-08-12 07:09:11 +00:00
John McCall 12d53da8cb Fix a crash on invalid when declaring an implicit member of a class with an
invalid destructor.

llvm-svn: 110891
2010-08-12 00:57:17 +00:00
Douglas Gregor 836a7e8468 Improve our handling of user-defined conversions when computing
implicit conversion sequences. In particular, model the "standard
conversion" from a class to its own type (or a base type) directly as
a standard conversion in the normal path *without* trying to determine
if there is a valid copy constructor. This appears to match the intent
of C++ [over.best.ics]p6 and more closely matches GCC and EDG.

As part of this, model non-lvalue reference initialization via
user-defined conversion in overloading the same way we handle it in
InitializationSequence, separating the "general user-defined
conversion" and "conversion to compatible class type" cases.

The churn in the overload-call-copycon.cpp test case is because the
test case was originally wrong; it assumed that we should do more
checking for copy constructors that we actually should, which affected
overload resolution.

Fixes PR7055. Bootstrapped okay.

llvm-svn: 110773
2010-08-11 02:15:33 +00:00
Douglas Gregor 86b8d9ff87 When attempting to recover from a failed unqualified name lookup, make
sure to clear out the LookupResult structure after looking into each class.

llvm-svn: 110615
2010-08-09 22:38:14 +00:00
Chandler Carruth 9b41823177 Fix a crash on template delete operators.
llvm-svn: 110542
2010-08-08 07:04:00 +00:00
Eli Friedman 9129b00c5f Make this test check a few more cases which didn't work correctly before
r110526.

llvm-svn: 110540
2010-08-08 05:07:06 +00:00
Eli Friedman aab1fda91f PR7800: both virtual and non-virtual bases must be marked as used for VTTs.
llvm-svn: 110526
2010-08-07 23:11:44 +00:00
Douglas Gregor a49ccfeeb2 The pre-increment/pre-decrement grammar in C++ differs from that in C,
but we were parsing the C grammar. Handle the C++ grammar
appropriately. Fixes PR7794.

llvm-svn: 110445
2010-08-06 14:50:36 +00:00
Douglas Gregor 59e8b3bd7b Introduce implicit conversions between AltiVec vectors and GCC
vectors, from Anton Yartsev!

llvm-svn: 110437
2010-08-06 10:14:59 +00:00
Eli Friedman 74ef7cf144 PR7769: Fix references to anonymous structs/unions in base classes in
offsetof expressions.

llvm-svn: 110327
2010-08-05 10:11:36 +00:00
Nick Lewycky ef7c0ffe40 Remove the warning for variables declared in the if-expression being used in
the else clause. The problem is that it's overly zealous and will respond to
uses in assignments, or after assignments. We should bring this back once we
can do it right. Fixes PR7100.

llvm-svn: 110314
2010-08-05 06:27:49 +00:00
Sebastian Redl e0351b970d Remove a redundant and broken check. Fixes PR7810.
llvm-svn: 110294
2010-08-05 00:45:34 +00:00
John McCall e16adc2b1e Emit standard-library RTTI with external linkage, not weak_odr.
Apply hidden visibility to most RTTI;  libstdc++ does not rely on exact
pointer equality for the type info (just the type info names).  Apply
the same optimization to RTTI that we do to vtables.

Fixes PR5962.

llvm-svn: 110192
2010-08-04 08:34:44 +00:00
John McCall deb646ebb5 Only look up an 'operator delete' on the definition of a destructor, not on
a declaration.

llvm-svn: 110175
2010-08-04 01:04:25 +00:00
John McCall 4a33fa95c0 Labels (and case statement) don't create independent scope parents for the
purposes of the jump checker.  Also extend Ted's iteration fix to labels.

Fixes PR7789.

llvm-svn: 110082
2010-08-02 23:33:14 +00:00
John McCall 8b0f4ff317 Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.

llvm-svn: 110063
2010-08-02 21:13:48 +00:00
John McCall 81c9cea24b Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.

llvm-svn: 109986
2010-08-01 21:51:45 +00:00
John McCall 47e40931c9 Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.

llvm-svn: 109984
2010-08-01 20:20:59 +00:00
John McCall d4e1b767f3 Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.

llvm-svn: 109964
2010-08-01 01:24:59 +00:00
Abramo Bagnara ed5b6899ab Fixed typedef inside extern "C".
llvm-svn: 109865
2010-07-30 16:47:02 +00:00
Douglas Gregor f65f490ae9 When deleting a value of class type, make sure that type is complete
before looking for conversions to pointer type. Fixes <rdar://problem/8248780>.

llvm-svn: 109749
2010-07-29 14:44:35 +00:00
Douglas Gregor a9c3e82755 Don't die when a member access refers to a non-class member via a
qualified name. Fixes <rdar://problem/8231724>.

llvm-svn: 109682
2010-07-28 22:27:52 +00:00
Eli Friedman 7530049b16 Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.
llvm-svn: 109537
2010-07-27 20:51:02 +00:00
Chris Lattner 938533db60 turn down the logical bitwise confusion warning to not warn
when the RHS of the ||/&& is ever 0 or 1.  This handles a variety of
creative idioms for "true" used in C programs and fixes many false 
positives at the expense of a few false negatives.  This fixes
rdar://8230351.

llvm-svn: 109314
2010-07-24 01:10:11 +00:00
Eli Friedman d4c75cddde Fix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;
fixes crashes on both valid and invalid code.  The diagnostic here could
potentially be improved, but it's good enough as-is.

llvm-svn: 109257
2010-07-23 19:25:41 +00:00
John McCall 7b5f0fe686 Ted pointed out that this test case could be using access control instead of
__attribute__((unavailable)).  I've done so, but unfortunately there's still a case
of redundant diagnostics.

llvm-svn: 109192
2010-07-22 22:44:38 +00:00
Ted Kremenek 1ddd6d2b6b Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent.  We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

llvm-svn: 109033
2010-07-21 20:43:11 +00:00
Chandler Carruth eeb3c8419f Make this grossness default to the error it should always be.
llvm-svn: 108511
2010-07-16 05:46:45 +00:00
Chandler Carruth 9339605c35 Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.
llvm-svn: 108505
2010-07-16 04:32:28 +00:00
Douglas Gregor cb2b662283 Make the "unused result" warning a warning about run-time behavior, so
that we don't warn when there isn't going to be any computation anyway.

llvm-svn: 108442
2010-07-15 18:47:04 +00:00
Douglas Gregor d9d45838e0 Add test case for PR5290; this bug was fixed with the non-class rvalue
de-cv-qualification fixes.

llvm-svn: 108437
2010-07-15 18:35:15 +00:00
Chandler Carruth cb3b5a483f Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to
the tests which no longer by default emit the warning. Added explicit test
cases for both C and C++ behavior with the warning turned on.

llvm-svn: 108325
2010-07-14 06:36:18 +00:00
Chris Lattner 8406c5197b Add a warning to catch a bug recently caught by code review, like this:
t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise &
      or remove constant [-Wlogical-bitwise-confusion]
  return x && 4;
           ^  ~

wording improvement suggestions are welcome.

llvm-svn: 108260
2010-07-13 19:41:32 +00:00
Douglas Gregor a8a089bfd5 Whenever we're creating an expression that is typically an rvalue
(e.g., a call, cast, etc.), immediately adjust the expression's type
to strip cv-qualifiers off of all non-class types (in C++) or all
types (in C). This effectively extends my previous fix for PR7463,
which was restricted to calls, to other kinds of expressions within
similar characteristics. I've audited every use of
getNonReferenceType() in the code base, switching to the newly-renamed
getNonLValueExprType() where necessary. 

Big thanks to Eli for pointing out just how incomplete my original fix
for PR7463 actually was. We've been handling cv-qualifiers on rvalues
wrong for a very, very long time. Fixes PR7463.

llvm-svn: 108253
2010-07-13 18:40:04 +00:00
Douglas Gregor f2753b3b4e Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like 

  new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.

llvm-svn: 108242
2010-07-13 15:54:32 +00:00
Douglas Gregor e82f087378 Improve diagnostics for the "type qualifier on return type has no
effect warning" by printing the qualifiers we saw and correctly
pluralizing the message, e.g.,

test/SemaCXX/conditional-expr.cpp:295:3: warning: 'const volatile' type
      qualifiers on return type have no effect
  const volatile Enum g2() {
  ^~~~~ ~~~~~~~~

llvm-svn: 108236
2010-07-13 08:50:30 +00:00
Douglas Gregor 603d81bf8d When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types. 

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).

llvm-svn: 108234
2010-07-13 08:18:22 +00:00
Douglas Gregor d8f446f1b2 Diagnose typedef of an operator name. Fixes PR7462
llvm-svn: 108233
2010-07-13 06:37:01 +00:00
John McCall a15eb737e4 Check in this -Wconversion C++ test case that's been sitting on my machine
for awhile.

llvm-svn: 108232
2010-07-13 06:26:23 +00:00
Douglas Gregor aa8c97262a Complain when an unnamed enumeration has no enumerations (in
C++). Fixes PR7466.

llvm-svn: 108231
2010-07-13 06:24:26 +00:00
Sebastian Redl 5467c9fac5 Produce an error on encountering a pointer or reference to a qualified function type. Fixes PR7470.
llvm-svn: 108209
2010-07-12 23:11:43 +00:00
Fariborz Jahanian 2f8bd36bcf Instantiation of byref variable in
block literal expression.

llvm-svn: 108019
2010-07-09 21:27:28 +00:00
Sebastian Redl 3e39272fed Slightly improve the diagnostic when using a qualified function typedef to declare nonmember or static member functions.
llvm-svn: 108018
2010-07-09 21:26:08 +00:00
Sebastian Redl caef9ab03c When looking for an entity's Scope, don't consider scopes that can't contain declarations. Fixes PR7594.
llvm-svn: 107927
2010-07-08 23:07:34 +00:00
Douglas Gregor eaff2cbbab Allow C-style casts and reinterpret_casts between block pointers and
either integer values or other pointers. Fixes <rdar://problem/8134521>.

llvm-svn: 107905
2010-07-08 20:27:32 +00:00
Douglas Gregor f609386058 Bowing to popular demand, reduce the "comma at end of enumerator list"
ExtWarn to an Extension. Let the broken code propagate!

llvm-svn: 107875
2010-07-08 14:54:42 +00:00
Douglas Gregor 747eb7840a Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

llvm-svn: 107857
2010-07-08 06:14:04 +00:00
Douglas Gregor e182370eda Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.

llvm-svn: 107837
2010-07-07 23:37:33 +00:00
Douglas Gregor 442612c285 Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.

llvm-svn: 107827
2010-07-07 22:35:13 +00:00
Benjamin Kramer ba62bda998 Unbreak test on platforms where size_t != unsigned long.
llvm-svn: 107574
2010-07-03 20:33:13 +00:00
John McCall 1e5d75d73f Mark the operator delete associated with a virtual destructor as referenced.
llvm-svn: 107573
2010-07-03 18:33:00 +00:00
Douglas Gregor 05dac7d154 By default, warn about commas at the end of an enumerator list in C++/C89.
llvm-svn: 107485
2010-07-02 16:17:01 +00:00
Douglas Gregor 957551609c Reinstate fix for PR7526, which was failing because, now that we
aren't dropping all exception specifications on destructors, the
exception specifications on implicitly-declared destructors were
detected as being wrong (which they were). 

Introduce logic to provide a proper exception-specification for
implicitly-declared destructors. This also fixes PR6972.

Note that the other implicitly-declared special member functions also
need to get exception-specifications. I'll deal with that in a
subsequent commit.

llvm-svn: 107385
2010-07-01 05:10:53 +00:00
Douglas Gregor 7c42659cee When performing copy initialization via user-defined conversions,
don't allow two user-defined conversions. Fixes PR6595 (again).

llvm-svn: 107379
2010-07-01 03:43:00 +00:00
Douglas Gregor 3671ad4571 Revert r107374, which broke bootstrap.
llvm-svn: 107378
2010-07-01 03:28:42 +00:00
Douglas Gregor c6e4c68371 When building the type of a destructor, make sure to keep the
exception specification. Fixes PR7526.

llvm-svn: 107374
2010-07-01 02:33:15 +00:00