From: Douglas Gregor Date: Fri, 29 Jan 2010 19:42:41 +0000 (+0000) Subject: PR5909 had a test case for binding of const, non-volatile references X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e14654b3b749421e21a4d917cdbcaf5589c0c6c3;p=clang PR5909 had a test case for binding of const, non-volatile references to bitfields. Add it here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94832 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp new file mode 100644 index 0000000000..cf529098df --- /dev/null +++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +namespace PR5909 { + struct Foo { + int x : 20; + }; + + bool Test(const int& foo); + + const Foo f = { 0 }; // It compiles without the 'const'. + bool z = Test(f.x); +}