]> granicus.if.org Git - clang/commitdiff
Commit Eli's fix for implicit conversions to array type. Fixes PR6264.
authorDouglas Gregor <dgregor@apple.com>
Fri, 26 Feb 2010 01:17:27 +0000 (01:17 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 26 Feb 2010 01:17:27 +0000 (01:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97202 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp

index 7b4a41777b6ac32ae1aca1290be65fd947c6ca6e..762f6db0a4c7af2d60e9bf0c0e3f854242ff2975 100644 (file)
@@ -2227,7 +2227,7 @@ static OverloadingResult TryRefInitWithConversionFunction(Sema &S,
                                            ToType, CandidateSet);
         else
           S.AddConversionCandidate(Conv, I.getAccess(), ActingDC,
-                                   Initializer, cv1T1, CandidateSet);
+                                   Initializer, ToType, CandidateSet);
       }
     }
   }
index cf529098dfe4f99da9345bf6985d884ce2d522c0..4c7ee942bd527b4633a0c8ef3f1a00f596bf0ba2 100644 (file)
@@ -10,3 +10,15 @@ namespace PR5909 {
   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();
+  }
+}