diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-08 02:53:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-08 02:53:02 +0000 |
commit | 92f241f1881246a657849e27d080fa939293d677 (patch) | |
tree | 9136df8550d176e330a8585afaf87309c1ec04e0 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | f77b0f888690e056e7da4efe94f5e97f996f6b05 (diff) | |
download | bcm5719-llvm-92f241f1881246a657849e27d080fa939293d677.tar.gz bcm5719-llvm-92f241f1881246a657849e27d080fa939293d677.zip |
Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.
This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.
This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.
llvm-svn: 169667
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 2355544ca84..337534eaac3 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1581,10 +1581,10 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, SemaRef.CheckOverrideControl(Method); // If a function is defined as defaulted or deleted, mark it as such now. - if (D->isDefaulted()) - Method->setDefaulted(); + if (D->isExplicitlyDefaulted()) + SemaRef.SetDeclDefaulted(Method, Method->getLocation()); if (D->isDeletedAsWritten()) - Method->setDeletedAsWritten(); + SemaRef.SetDeclDeleted(Method, Method->getLocation()); // If there's a function template, let our caller handle it. if (FunctionTemplate) { @@ -1610,13 +1610,6 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, Owner->addDecl(Method); } - if (D->isExplicitlyDefaulted()) { - SemaRef.SetDeclDefaulted(Method, Method->getLocation()); - } else { - assert(!D->isDefaulted() && - "should not implicitly default uninstantiated function"); - } - return Method; } |