Commit Graph

11 Commits

Author SHA1 Message Date
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
Anders Carlsson 58e24a8fd8 Change the 'declared at' diagnostic to say 'declared here'.
llvm-svn: 102163
2010-04-23 02:20:12 +00:00
John McCall 85f9055955 When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.

llvm-svn: 98149
2010-03-10 11:27:22 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Eli Friedman 9cf6b59400 Add additional note to mark the cause of synthesized constructors. Mark
declaration invalid if the constructor can't be properly built.  Addresses
remaining review comments from Fariborz for r86500.

llvm-svn: 86579
2009-11-09 19:20:36 +00:00
Eli Friedman d7686ef31c Unify the codepaths used to verify base and member initializers for explicitly
and implicitly defined constructors.  This has a number of benefits:

1. Less code.

2. Explicit and implicit constructors get the same diagnostics.

3. The AST explicitly contains constructor calls from implicit default
constructors.  This allows handing some cases that previously weren't handled
correctly in IRGen without any additional code. Specifically, implicit default
constructors containing calls to constructors with default arguments are now
handled correctly.

llvm-svn: 86500
2009-11-09 01:05:47 +00:00
Fariborz Jahanian 8ae5b0a18b Fix up error reporting when object cannot be constructed
because of missing default constructor of a member.
Fixes pr5154.

llvm-svn: 83583
2009-10-08 22:15:49 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Anders Carlsson 52b9180587 Pass the DeclName to the diagnostic builder so that member names will be quoted correctly.
llvm-svn: 75150
2009-07-09 17:37:12 +00:00
Fariborz Jahanian 246219bc9f Fixed text of a diagnostics.
llvm-svn: 73885
2009-06-22 16:33:37 +00:00
Fariborz Jahanian 1c9d5d956c Made improvements in c++'s object model patch on Doug's review.
llvm-svn: 73833
2009-06-20 20:23:38 +00:00