[cfe-commits] r97202 - in /cfe/trunk: lib/Sema/SemaInit.cpp test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
Douglas Gregor
dgregor at apple.com
Thu Feb 25 17:17:27 PST 2010
Author: dgregor
Date: Thu Feb 25 19:17:27 2010
New Revision: 97202
URL: http://llvm.org/viewvc/llvm-project?rev=97202&view=rev
Log:
Commit Eli's fix for implicit conversions to array type. Fixes PR6264.
Modified:
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=97202&r1=97201&r2=97202&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Feb 25 19:17:27 2010
@@ -2227,7 +2227,7 @@
ToType, CandidateSet);
else
S.AddConversionCandidate(Conv, I.getAccess(), ActingDC,
- Initializer, cv1T1, CandidateSet);
+ Initializer, ToType, CandidateSet);
}
}
}
Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp?rev=97202&r1=97201&r2=97202&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp Thu Feb 25 19:17:27 2010
@@ -10,3 +10,15 @@
const Foo f = { 0 }; // It compiles without the 'const'.
bool z = Test(f.x);
}
+
+namespace PR6264 {
+ typedef int (&T)[3];
+ struct S
+ {
+ operator T ();
+ };
+ void f()
+ {
+ T bar = S();
+ }
+}
More information about the cfe-commits
mailing list