Commit Graph

8 Commits

Author SHA1 Message Date
Douglas Gregor 5d3507d39c Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.

llvm-svn: 81394
2009-09-09 23:08:42 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Sebastian Redl 2175b6a767 Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

llvm-svn: 64025
2009-02-07 19:52:04 +00:00
Douglas Gregor fc4f8a1834 Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a
bit... interesting... but we follow GNU's lead and don't permit too
much crazy code in this area.

Also, make the "excess initializers" error message a bit more
informative.

Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561

llvm-svn: 63785
2009-02-04 22:46:25 +00:00
Douglas Gregor a5c9e1ae93 Check value-initializations that occur when an initializer list
provides too few elements.

llvm-svn: 63525
2009-02-02 17:43:21 +00:00
Douglas Gregor 576e98cc1e Improve our handling of the second step in a user-defined conversion
sequence. Previously, we weren't permitting the second step to call
copy constructors, which left user-defined conversion sequences
surprisingly broken.

Now, we perform overload resolution among all of the constructors, but
only accept the result if it makes the conversion a standard
conversion. Note that this behavior is different from both GCC and EDG
(which don't agree with each other, either); I've submitted a core
issue on the matter.

llvm-svn: 63450
2009-01-30 23:27:23 +00:00
Douglas Gregor d42a0fb41b Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.

llvm-svn: 63435
2009-01-30 22:26:29 +00:00
Douglas Gregor d14247a9e5 Implement and test aggregate initialization in C++. Major changes:
- Support initialization of reference members; complain if any
  reference members are left uninitialized.
  - Use C++ copy-initialization for initializing each element (falls
  back to constraint checking in C)
  - Make sure we diagnose when one tries to provide an initializer
  list for a non-aggregate.
  - Don't complain about empty initializers in C++ (they are permitted)
  - Unrelated but necessary: don't bother trying to convert the
  decl-specifier-seq to a type when we're dealing with a C++
  constructor, destructor, or conversion operator; it results in
  spurious warnings.

llvm-svn: 63431
2009-01-30 22:09:00 +00:00