diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-01-12 20:32:25 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-01-12 20:32:25 +0000 |
commit | 5535c38a2fcface6c13bc8bbeca66882de2fa227 (patch) | |
tree | b22ed8971f2daf7571379a65a3d21f5318b6e131 /test/CodeGenCXX/reference-init.cpp | |
parent | e9cde116a9beac8ad0acd99b9face9d07990cc73 (diff) |
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
Diffstat (limited to 'test/CodeGenCXX/reference-init.cpp')
-rw-r--r-- | test/CodeGenCXX/reference-init.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 <typename T, int N> int f(const T (&a)[N]) { return N; } + int iarr[] = { 1 }; + int test() { return f(iarr); } +} |