From 5535c38a2fcface6c13bc8bbeca66882de2fa227 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 12 Jan 2010 20:32:25 +0000 Subject: Fix the CodeGen half of PR5911 by changing reference initialization to correctly look through arrays to see cv-qualifiers. Also enhances the routine for doing this to preserve more type sugaring for diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93252 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/reference-init.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/CodeGenCXX/reference-init.cpp') diff --git a/test/CodeGenCXX/reference-init.cpp b/test/CodeGenCXX/reference-init.cpp index 1bfb28a66a..6c2c6a3016 100644 --- a/test/CodeGenCXX/reference-init.cpp +++ b/test/CodeGenCXX/reference-init.cpp @@ -7,3 +7,10 @@ struct nsXPTParamInfo { void a(XPTParamDescriptor *params) { const nsXPTParamInfo& paramInfo = params[0]; } + +// CodeGen of reference initialized const arrays. +namespace PR5911 { + template int f(const T (&a)[N]) { return N; } + int iarr[] = { 1 }; + int test() { return f(iarr); } +} -- cgit v1.2.3-70-g09d2