[cfe-commits] r88718 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/AST/DeclCXX.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaOverload.cpp lib/Sema/SemaTemplateDeduction.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/constructor-recovery.cpp test/SemaCXX/copy-constructor-error.cpp test/SemaTemplate/constructor-template.cpp test/SemaTemplate/operator-template.cpp

Douglas Gregor dgregor at apple.com
Fri Nov 13 15:43:59 PST 2009


On Nov 13, 2009, at 3:14 PM, Douglas Gregor wrote:

> Author: dgregor
> Date: Fri Nov 13 17:14:53 2009
> New Revision: 88718
>
> URL: http://llvm.org/viewvc/llvm-project?rev=88718&view=rev
> Log:
> A constructor template cannot be instantiated to a copy
> constructor. Make sure that such declarations can never be formed.
>
> Modified:
>    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>    cfe/trunk/lib/AST/DeclCXX.cpp
>    cfe/trunk/lib/Sema/SemaDecl.cpp
>    cfe/trunk/lib/Sema/SemaOverload.cpp
>    cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
>    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
>    cfe/trunk/test/SemaCXX/constructor-recovery.cpp
>    cfe/trunk/test/SemaCXX/copy-constructor-error.cpp
>    cfe/trunk/test/SemaTemplate/constructor-template.cpp
>    cfe/trunk/test/SemaTemplate/operator-template.cpp

John noted that this solution is completely and utterly broken. At  
issue is a constructor template like this:

   struct X {
     template<typename T> X(const X&, T = T());
   };

which we will prematurely reject. I'll be reverting r88718 and trying  
again...

	- Doug



More information about the cfe-commits mailing list