[cfe-commits] r115588 - in /cfe/trunk: lib/Sema/SemaInit.cpp test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Oct 4 20:05:30 PDT 2010
Author: akirtzidis
Date: Mon Oct 4 22:05:30 2010
New Revision: 115588
URL: http://llvm.org/viewvc/llvm-project?rev=115588&view=rev
Log:
In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!
Modified:
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=115588&r1=115587&r2=115588&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Mon Oct 4 22:05:30 2010
@@ -2325,10 +2325,12 @@
if (ConstructorTmpl)
S.AddTemplateOverloadCandidate(ConstructorTmpl, FoundDecl,
/*ExplicitArgs*/ 0,
- &Initializer, 1, CandidateSet);
+ &Initializer, 1, CandidateSet,
+ /*SuppressUserConversions=*/true);
else
S.AddOverloadCandidate(Constructor, FoundDecl,
- &Initializer, 1, CandidateSet);
+ &Initializer, 1, CandidateSet,
+ /*SuppressUserConversions=*/true);
}
}
}
Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp?rev=115588&r1=115587&r2=115588&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp Mon Oct 4 22:05:30 2010
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-struct Base { }; // expected-note{{candidate is the implicit copy constructor}}
+struct Base { };
struct Derived : Base { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
struct Unrelated { };
struct Derived2 : Base { };
More information about the cfe-commits
mailing list