Index: lib/Sema/SemaInit.cpp =================================================================== --- lib/Sema/SemaInit.cpp +++ lib/Sema/SemaInit.cpp @@ -4087,6 +4087,12 @@ = S.CompareReferenceRelationship(DeclLoc, cv1T1, cv2T2, DerivedToBase, ObjCConversion, ObjCLifetimeConversion); + + if (isLValueRef && (!T1Quals.hasVolatile() && T2Quals.hasVolatile())) { + Sequence.SetFailed(InitializationSequence::FK_ReferenceInitDropsQualifiers); + return; + } + // C++0x [dcl.init.ref]p5: // A reference to type "cv1 T1" is initialized by an expression of type // "cv2 T2" as follows: Index: test/SemaCXX/bind-infinite-recursion.cpp =================================================================== --- test/SemaCXX/bind-infinite-recursion.cpp +++ test/SemaCXX/bind-infinite-recursion.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 %s -fsyntax-only -verify + +struct S; + +struct W { + W( const S& ) {} // expected-note {{passing argument to parameter here}} +}; + +struct S { + S(volatile W) {} +}; + +int main() { + volatile W *w = 0; + S s(*w); // expected-error {{binding value of type 'volatile W' to reference to type 'const S' drops 'volatile' qualifier}} + return 0; +} +