aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/reference-init.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-01-12 20:32:25 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-01-12 20:32:25 +0000
commit04bdce64074c03446f9e31e4a99ff2d2730c89a9 (patch)
tree188b018c7b7930baf5101d51a920c805299ac939 /clang/test/CodeGenCXX/reference-init.cpp
parent7c743f2c7474105654716a4398394b48d84c1e7f (diff)
downloadllvm-04bdce64074c03446f9e31e4a99ff2d2730c89a9.zip
llvm-04bdce64074c03446f9e31e4a99ff2d2730c89a9.tar.gz
llvm-04bdce64074c03446f9e31e4a99ff2d2730c89a9.tar.bz2
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. llvm-svn: 93252
Diffstat (limited to 'clang/test/CodeGenCXX/reference-init.cpp')
-rw-r--r--clang/test/CodeGenCXX/reference-init.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/reference-init.cpp b/clang/test/CodeGenCXX/reference-init.cpp
index 1bfb28a..6c2c6a3 100644
--- a/clang/test/CodeGenCXX/reference-init.cpp
+++ b/clang/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); }
+}