]> granicus.if.org Git - clang/commitdiff
PR5909 had a test case for binding of const, non-volatile references
authorDouglas Gregor <dgregor@apple.com>
Fri, 29 Jan 2010 19:42:41 +0000 (19:42 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 29 Jan 2010 19:42:41 +0000 (19:42 +0000)
to bitfields. Add it here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94832 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5.cpp [new file with mode: 0644]

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 (file)
index 0000000..cf52909
--- /dev/null
@@ -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);
+}