From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CXX/temp/p3.cpp | 18 + .../CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp | 60 +++ .../test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp | 95 +++++ .../test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp | 205 +++++++++++ .../CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp | 40 ++ .../CXX/temp/temp.arg/temp.arg.type/p2-cxx0x.cpp | 20 + clang/test/CXX/temp/temp.arg/temp.arg.type/p2.cpp | 42 +++ clang/test/CXX/temp/temp.decls/p3.cpp | 7 + clang/test/CXX/temp/temp.decls/temp.alias/p1.cpp | 8 + clang/test/CXX/temp/temp.decls/temp.alias/p2.cpp | 45 +++ clang/test/CXX/temp/temp.decls/temp.alias/p3.cpp | 13 + .../CXX/temp/temp.decls/temp.class.spec/p6.cpp | 76 ++++ .../CXX/temp/temp.decls/temp.class.spec/p8-0x.cpp | 8 + .../CXX/temp/temp.decls/temp.class.spec/p9-0x.cpp | 13 + .../CXX/temp/temp.decls/temp.class.spec/p9.cpp | 26 ++ .../temp.class.spec/temp.class.order/p2.cpp | 48 +++ .../temp.class.spec.mfunc/p1-neg.cpp | 25 ++ .../temp.class.spec/temp.class.spec.mfunc/p1.cpp | 25 ++ .../temp.decls/temp.class/temp.mem.class/p1.cpp | 27 ++ .../temp.decls/temp.class/temp.mem.enum/p1.cpp | 152 ++++++++ .../temp.class/temp.mem.func/p1-retmem.cpp | 28 ++ .../temp.decls/temp.class/temp.mem.func/p1.cpp | 100 +++++ .../temp.decls/temp.class/temp.mem.func/p1inst.cpp | 17 + .../temp.decls/temp.class/temp.mem.func/pr5056.cpp | 17 + .../temp.decls/temp.class/temp.static/p1-inst.cpp | 28 ++ .../temp/temp.decls/temp.class/temp.static/p1.cpp | 26 ++ .../temp.decls/temp.fct/temp.func.order/p3-0x.cpp | 17 + .../temp.decls/temp.fct/temp.func.order/p3.cpp | 16 + .../temp.decls/temp.fct/temp.func.order/p4.cpp | 23 ++ .../temp.decls/temp.fct/temp.func.order/p5.cpp | 12 + .../temp.decls/temp.fct/temp.over.link/p4-neg.cpp | 27 ++ .../temp/temp.decls/temp.fct/temp.over.link/p4.cpp | 13 + .../temp/temp.decls/temp.fct/temp.over.link/p6.cpp | 16 + clang/test/CXX/temp/temp.decls/temp.friend/p1.cpp | 358 ++++++++++++++++++ clang/test/CXX/temp/temp.decls/temp.friend/p3.cpp | 12 + clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp | 28 ++ clang/test/CXX/temp/temp.decls/temp.friend/p5.cpp | 103 ++++++ clang/test/CXX/temp/temp.decls/temp.friend/p8.cpp | 6 + clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp | 35 ++ clang/test/CXX/temp/temp.decls/temp.mem/p3.cpp | 6 + clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp | 79 ++++ .../temp/temp.decls/temp.variadic/deduction.cpp | 50 +++ .../temp/temp.decls/temp.variadic/example-bind.cpp | 352 ++++++++++++++++++ .../temp.decls/temp.variadic/example-function.cpp | 86 +++++ .../temp.decls/temp.variadic/example-tuple.cpp | 260 +++++++++++++ .../temp/temp.decls/temp.variadic/ext-blocks.cpp | 46 +++ .../temp.decls/temp.variadic/fixed-expansion.cpp | 127 +++++++ .../temp.variadic/injected-class-name.cpp | 75 ++++ .../temp.decls/temp.variadic/metafunctions.cpp | 274 ++++++++++++++ .../temp.variadic/multi-level-substitution.cpp | 251 +++++++++++++ .../test/CXX/temp/temp.decls/temp.variadic/p1.cpp | 9 + .../test/CXX/temp/temp.decls/temp.variadic/p2.cpp | 22 ++ .../test/CXX/temp/temp.decls/temp.variadic/p4.cpp | 193 ++++++++++ .../test/CXX/temp/temp.decls/temp.variadic/p5.cpp | 403 +++++++++++++++++++++ .../temp.variadic/parameter-matching.cpp | 43 +++ .../temp.decls/temp.variadic/partial-ordering.cpp | 61 ++++ .../temp/temp.fct.spec/temp.arg.explicit/p1.cpp | 12 + .../temp/temp.fct.spec/temp.arg.explicit/p3-0x.cpp | 27 ++ .../temp.arg.explicit/p3-nodeduct.cpp | 36 ++ .../temp/temp.fct.spec/temp.arg.explicit/p3.cpp | 65 ++++ .../temp/temp.fct.spec/temp.arg.explicit/p9-0x.cpp | 68 ++++ .../CXX/temp/temp.fct.spec/temp.deduct/cwg1170.cpp | 41 +++ .../test/CXX/temp/temp.fct.spec/temp.deduct/p9.cpp | 26 ++ .../temp/temp.fct.spec/temp.deduct/sfinae-1.cpp | 42 +++ .../temp.deduct/temp.deduct.call/basic.cpp | 30 ++ .../temp.deduct/temp.deduct.call/p1-0x.cpp | 88 +++++ .../temp.deduct/temp.deduct.call/p2.cpp | 31 ++ .../temp.deduct/temp.deduct.call/p3-0x.cpp | 46 +++ .../temp.deduct/temp.deduct.call/p3.cpp | 148 ++++++++ .../temp.deduct/temp.deduct.call/p4.cpp | 20 + .../temp.deduct/temp.deduct.call/p6.cpp | 128 +++++++ .../temp.deduct/temp.deduct.conv/p2.cpp | 36 ++ .../temp.deduct/temp.deduct.conv/p3.cpp | 30 ++ .../temp.deduct/temp.deduct.conv/p4.cpp | 44 +++ .../temp.deduct/temp.deduct.funcaddr/p1.cpp | 22 ++ .../temp.deduct/temp.deduct.partial/p11.cpp | 47 +++ .../temp.deduct/temp.deduct.partial/p12.cpp | 27 ++ .../temp.deduct/temp.deduct.partial/p9-0x.cpp | 10 + .../temp.deduct/temp.deduct.type/p10-0x.cpp | 4 + .../temp.deduct/temp.deduct.type/p17.cpp | 31 ++ .../temp.deduct/temp.deduct.type/p2-0x.cpp | 23 ++ .../temp.deduct/temp.deduct.type/p21.cpp | 31 ++ .../temp.deduct/temp.deduct.type/p22.cpp | 14 + .../temp.deduct/temp.deduct.type/p5-0x.cpp | 22 ++ .../temp.deduct/temp.deduct.type/p8-0x.cpp | 47 +++ .../temp.deduct/temp.deduct.type/p9-0x.cpp | 55 +++ clang/test/CXX/temp/temp.names/p2.cpp | 13 + clang/test/CXX/temp/temp.names/p4.cpp | 15 + clang/test/CXX/temp/temp.param/p1.cpp | 12 + clang/test/CXX/temp/temp.param/p10-0x.cpp | 13 + clang/test/CXX/temp/temp.param/p10.cpp | 12 + clang/test/CXX/temp/temp.param/p11-0x.cpp | 81 +++++ clang/test/CXX/temp/temp.param/p11.cpp | 15 + clang/test/CXX/temp/temp.param/p12.cpp | 39 ++ clang/test/CXX/temp/temp.param/p13.cpp | 14 + clang/test/CXX/temp/temp.param/p14.cpp | 5 + clang/test/CXX/temp/temp.param/p15-cxx0x.cpp | 24 ++ clang/test/CXX/temp/temp.param/p15.cpp | 12 + clang/test/CXX/temp/temp.param/p2.cpp | 22 ++ clang/test/CXX/temp/temp.param/p3.cpp | 40 ++ clang/test/CXX/temp/temp.param/p4.cpp | 21 ++ clang/test/CXX/temp/temp.param/p5.cpp | 13 + clang/test/CXX/temp/temp.param/p7.cpp | 15 + clang/test/CXX/temp/temp.param/p8.cpp | 6 + clang/test/CXX/temp/temp.param/p9-0x.cpp | 61 ++++ clang/test/CXX/temp/temp.param/p9.cpp | 23 ++ .../temp/temp.res/temp.dep.res/temp.point/p1.cpp | 32 ++ clang/test/CXX/temp/temp.res/temp.dep/p3.cpp | 43 +++ .../temp.res/temp.dep/temp.dep.constexpr/p2-0x.cpp | 27 ++ .../temp.res/temp.dep/temp.dep.constexpr/p2.cpp | 21 ++ .../temp/temp.res/temp.dep/temp.dep.type/p1.cpp | 30 ++ clang/test/CXX/temp/temp.res/temp.local/p1.cpp | 32 ++ clang/test/CXX/temp/temp.res/temp.local/p3.cpp | 32 ++ clang/test/CXX/temp/temp.res/temp.local/p7.cpp | 10 + clang/test/CXX/temp/temp.res/temp.local/p8.cpp | 53 +++ clang/test/CXX/temp/temp.res/temp.local/p9.cpp | 15 + clang/test/CXX/temp/temp.spec/p5.cpp | 47 +++ .../CXX/temp/temp.spec/temp.expl.spec/examples.cpp | 334 +++++++++++++++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p1.cpp | 99 +++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp | 7 + .../test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp | 8 + .../test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp | 6 + .../test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp | 42 +++ .../test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp | 33 ++ .../test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp | 38 ++ .../test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp | 34 ++ .../test/CXX/temp/temp.spec/temp.expl.spec/p18.cpp | 20 + .../test/CXX/temp/temp.spec/temp.expl.spec/p19.cpp | 30 ++ .../CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp | 302 +++++++++++++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp | 252 +++++++++++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp | 14 + .../test/CXX/temp/temp.spec/temp.expl.spec/p21.cpp | 30 ++ .../test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp | 13 + .../test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp | 58 +++ .../temp/temp.spec/temp.expl.spec/p5-example.cpp | 34 ++ .../test/CXX/temp/temp.spec/temp.expl.spec/p5.cpp | 61 ++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p6.cpp | 63 ++++ .../test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp | 14 + .../CXX/temp/temp.spec/temp.explicit/p1-0x.cpp | 24 ++ .../CXX/temp/temp.spec/temp.explicit/p1-emit.cpp | 29 ++ clang/test/CXX/temp/temp.spec/temp.explicit/p1.cpp | 89 +++++ .../test/CXX/temp/temp.spec/temp.explicit/p10.cpp | 33 ++ .../test/CXX/temp/temp.spec/temp.explicit/p11.cpp | 18 + .../test/CXX/temp/temp.spec/temp.explicit/p12.cpp | 6 + clang/test/CXX/temp/temp.spec/temp.explicit/p2.cpp | 43 +++ .../CXX/temp/temp.spec/temp.explicit/p3-0x.cpp | 65 ++++ clang/test/CXX/temp/temp.spec/temp.explicit/p3.cpp | 81 +++++ clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp | 48 +++ clang/test/CXX/temp/temp.spec/temp.explicit/p5.cpp | 17 + clang/test/CXX/temp/temp.spec/temp.explicit/p6.cpp | 35 ++ clang/test/CXX/temp/temp.spec/temp.explicit/p7.cpp | 36 ++ clang/test/CXX/temp/temp.spec/temp.explicit/p8.cpp | 40 ++ .../temp/temp.spec/temp.explicit/p9-linkage.cpp | 66 ++++ clang/test/CXX/temp/temp.spec/temp.explicit/p9.cpp | 59 +++ clang/test/CXX/temp/temp.spec/temp.inst/p1.cpp | 104 ++++++ clang/test/CXX/temp/temp.spec/temp.inst/p11.cpp | 15 + clang/test/CXX/temp/temp.type/p1-0x.cpp | 23 ++ 157 files changed, 8544 insertions(+) create mode 100644 clang/test/CXX/temp/p3.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.type/p2-cxx0x.cpp create mode 100644 clang/test/CXX/temp/temp.arg/temp.arg.type/p2.cpp create mode 100644 clang/test/CXX/temp/temp.decls/p3.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.alias/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.alias/p2.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.alias/p3.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/p6.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/p8-0x.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/p9-0x.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/p9.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.order/p2.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1-neg.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.class/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.enum/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1-retmem.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1inst.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.mem.func/pr5056.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3-0x.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p3.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p5.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p6.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.friend/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.friend/p3.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.friend/p4.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.friend/p5.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.friend/p8.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.mem/p3.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/deduction.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/example-bind.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/example-function.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/example-tuple.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/ext-blocks.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/fixed-expansion.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/injected-class-name.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/p1.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/p2.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp create mode 100644 clang/test/CXX/temp/temp.decls/temp.variadic/partial-ordering.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p1.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p9-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/cwg1170.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/p9.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/sfinae-1.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p4.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p2.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.conv/p4.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p12.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p9-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p10-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p2-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p21.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p22.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p8-0x.cpp create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp create mode 100644 clang/test/CXX/temp/temp.names/p2.cpp create mode 100644 clang/test/CXX/temp/temp.names/p4.cpp create mode 100644 clang/test/CXX/temp/temp.param/p1.cpp create mode 100644 clang/test/CXX/temp/temp.param/p10-0x.cpp create mode 100644 clang/test/CXX/temp/temp.param/p10.cpp create mode 100644 clang/test/CXX/temp/temp.param/p11-0x.cpp create mode 100644 clang/test/CXX/temp/temp.param/p11.cpp create mode 100644 clang/test/CXX/temp/temp.param/p12.cpp create mode 100644 clang/test/CXX/temp/temp.param/p13.cpp create mode 100644 clang/test/CXX/temp/temp.param/p14.cpp create mode 100644 clang/test/CXX/temp/temp.param/p15-cxx0x.cpp create mode 100644 clang/test/CXX/temp/temp.param/p15.cpp create mode 100644 clang/test/CXX/temp/temp.param/p2.cpp create mode 100644 clang/test/CXX/temp/temp.param/p3.cpp create mode 100644 clang/test/CXX/temp/temp.param/p4.cpp create mode 100644 clang/test/CXX/temp/temp.param/p5.cpp create mode 100644 clang/test/CXX/temp/temp.param/p7.cpp create mode 100644 clang/test/CXX/temp/temp.param/p8.cpp create mode 100644 clang/test/CXX/temp/temp.param/p9-0x.cpp create mode 100644 clang/test/CXX/temp/temp.param/p9.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.dep.res/temp.point/p1.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.dep/p3.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2-0x.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.dep/temp.dep.constexpr/p2.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.dep/temp.dep.type/p1.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.local/p1.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.local/p3.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.local/p7.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.local/p8.cpp create mode 100644 clang/test/CXX/temp/temp.res/temp.local/p9.cpp create mode 100644 clang/test/CXX/temp/temp.spec/p5.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/examples.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p1.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p10.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p11.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p13.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p17.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p18.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p19.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-0x.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p21.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p3.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p4.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p5-example.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p5.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p6.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p9.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p1-0x.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p1-emit.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p1.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p10.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p11.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p12.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p2.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p3.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p5.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p6.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p7.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p8.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p9.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.inst/p1.cpp create mode 100644 clang/test/CXX/temp/temp.spec/temp.inst/p11.cpp create mode 100644 clang/test/CXX/temp/temp.type/p1-0x.cpp (limited to 'clang/test/CXX/temp') diff --git a/clang/test/CXX/temp/p3.cpp b/clang/test/CXX/temp/p3.cpp new file mode 100644 index 0000000..c146bc4 --- /dev/null +++ b/clang/test/CXX/temp/p3.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -verify %s + +template struct S { + static int a, b; +}; + +template int S::a, S::b; // expected-error {{can only declare a single entity}} + +template struct A { static A a; } A::a; // expected-error {{expected ';' after struct}} \ + expected-error {{use of undeclared identifier 'T'}} \ + expected-warning{{extra qualification}} + +template struct B { } f(); // expected-error {{expected ';' after struct}} \ + expected-error {{requires a type specifier}} + +template struct C { } // expected-error {{expected ';' after struct}} + +A c; diff --git a/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp new file mode 100644 index 0000000..59ce8b6 --- /dev/null +++ b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp @@ -0,0 +1,60 @@ +// RUN: %clang_cc1 -std=c++11 %s -verify + +namespace std { + typedef decltype(nullptr) nullptr_t; +} + +template struct IP { // expected-note 4 {{template parameter is declared here}} + IP *ip2; +}; + +constexpr std::nullptr_t get_nullptr() { return nullptr; } + +constexpr std::nullptr_t np = nullptr; + +std::nullptr_t nonconst_np; // expected-note{{declared here}} + +IP<0> ip0; // expected-error{{null non-type template argument must be cast to template parameter type 'int *'}} +IP<(0)> ip1; // expected-error{{null non-type template argument must be cast to template parameter type 'int *'}} +IP ip2; +IP ip3; +IP<(int*)0> ip4; +IP ip5; +IP ip5; // expected-error{{non-type template argument of type 'std::nullptr_t' (aka 'nullptr_t') is not a constant expression}} \ +// expected-note{{read of non-constexpr variable 'nonconst_np' is not allowed in a constant expression}} +IP<(float*)0> ip6; // expected-error{{null non-type template argument of type 'float *' does not match template parameter of type 'int *'}} + +struct X { }; +template struct PM { // expected-note 2 {{template parameter is declared here}} + PM *pm2; +}; + +PM<0> pm0; // expected-error{{null non-type template argument must be cast to template parameter type 'int X::*'}} +PM<(0)> pm1; // expected-error{{null non-type template argument must be cast to template parameter type 'int X::*'}} +PM pm2; +PM pm3; +PM<(int X::*)0> pm4; +PM pm5; + +template struct PMF { // expected-note 2 {{template parameter is declared here}} + PMF *pmf2; +}; + +PMF<0> pmf0; // expected-error{{null non-type template argument must be cast to template parameter type 'int (X::*)(int)'}} +PMF<(0)> pmf1; // expected-error{{null non-type template argument must be cast to template parameter type 'int (X::*)(int)'}} +PMF pmf2; +PMF pmf3; +PMF<(int (X::*)(int))0> pmf4; +PMF pmf5; + + +template struct NP { // expected-note 2{{template parameter is declared here}} + NP *np2; +}; + +NP np1; +NP np2; +NP np3; +NP<0> np4; // expected-error{{null non-type template argument must be cast to template parameter type 'std::nullptr_t' (aka 'nullptr_t')}} +constexpr int i = 7; +NP np5; // expected-error{{non-type template argument of type 'const int' cannot be converted to a value of type 'std::nullptr_t'}} diff --git a/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp new file mode 100644 index 0000000..c4db002 --- /dev/null +++ b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp @@ -0,0 +1,95 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-linux-gnu %s + +// C++11 [temp.arg.nontype]p1: +// +// A template-argument for a non-type, non-template template-parameter shall +// be one of: +// -- an integral constant expression; or +// -- the name of a non-type template-parameter ; or +namespace non_type_tmpl_param { + template struct X0 { X0(); }; + template X0::X0() { } + template struct X1 { X1(); }; + template X1::X1() { } + template struct X3 { X3(); }; + template X3::X3() { } + template struct X4 { X4(); }; + template X4::X4() { } + template struct X5 { X5(); }; + template X5::X5() { } +} + +// -- a constant expression that designates the address of an object with +// static storage duration and external or internal linkage or a function +// with external or internal linkage, including function templates and +// function template-ids, but excluting non-static class members, expressed +// (ignoring parentheses) as & id-expression, except that the & may be +// omitted if the name refers to a function or array and shall be omitted +// if the corresopnding template-parameter is a reference; or +namespace addr_of_obj_or_func { + template struct X0 { }; // expected-note 4{{here}} + template struct X1 { }; + template struct X2 { }; // expected-note 4{{here}} + template struct X2k { }; // expected-note {{here}} + template struct X3 { }; // expected-note 4{{here}} + + int i = 42; + int iarr[10]; + int f(int i); + const int ki = 9; // expected-note 5{{here}} + __thread int ti = 100; // expected-note 2{{here}} + static int f_internal(int); // expected-note 4{{here}} + template T f_tmpl(T t); + + void test() { + X0 x0a; // expected-error {{must have its address taken}} + X0<&i> x0a_addr; + X0 x0b; + X0<&iarr> x0b_addr; // expected-error {{cannot be converted to a value of type 'int *'}} + X0 x0c; // expected-error {{must have its address taken}} expected-warning {{internal linkage is a C++11 extension}} + X0<&ki> x0c_addr; // expected-error {{cannot be converted to a value of type 'int *'}} expected-warning {{internal linkage is a C++11 extension}} + X0<&ti> x0d_addr; // expected-error {{refers to thread-local object}} + X1 x1a; + X1<&f> x1a_addr; + X1 x1b; + X1<&f_tmpl> x1b_addr; + X1 > x1c; + X1<&f_tmpl > x1c_addr; + X1 x1d; // expected-warning {{internal linkage is a C++11 extension}} + X1<&f_internal> x1d_addr; // expected-warning {{internal linkage is a C++11 extension}} + X2 x2a; + X2<&i> x2a_addr; // expected-error {{address taken}} + X2 x2b; // expected-error {{cannot bind to template argument of type 'int [10]'}} + X2<&iarr> x2b_addr; // expected-error {{address taken}} + X2 x2c; // expected-error {{ignores qualifiers}} expected-warning {{internal linkage is a C++11 extension}} + X2k x2kc; // expected-warning {{internal linkage is a C++11 extension}} + X2k<&ki> x2kc_addr; // expected-error {{address taken}} expected-warning {{internal linkage is a C++11 extension}} + X2 x2d_addr; // expected-error {{refers to thread-local object}} + X3 x3a; + X3<&f> x3a_addr; // expected-error {{address taken}} + X3 x3b; + X3<&f_tmpl> x3b_addr; // expected-error {{address taken}} + X3 > x3c; + X3<&f_tmpl > x3c_addr; // expected-error {{address taken}} + X3 x3d; // expected-warning {{internal linkage is a C++11 extension}} + X3<&f_internal> x3d_addr; // expected-error {{address taken}} expected-warning {{internal linkage is a C++11 extension}} + + int n; // expected-note {{here}} + X0<&n> x0_no_linkage; // expected-error {{non-type template argument refers to object 'n' that does not have linkage}} + struct Local { static int f() {} }; // expected-note {{here}} + X1<&Local::f> x1_no_linkage; // expected-error {{non-type template argument refers to function 'f' that does not have linkage}} + } +} + +// -- a constant expression that evaluates to a null pointer value (4.10); or +// -- a constant expression that evaluates to a null member pointer value +// (4.11); or +// -- a pointer to member expressed as described in 5.3.1. + +namespace bad_args { + template struct X0 { }; // expected-note 2{{template parameter is declared here}} + int i = 42; + X0<&i + 2> x0a; // expected-error{{non-type template argument does not refer to any declaration}} + int* iptr = &i; + X0 x0b; // expected-error{{non-type template argument for template parameter of pointer type 'int *' must have its address taken}} +} diff --git a/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp new file mode 100644 index 0000000..9b9b532 --- /dev/null +++ b/clang/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp @@ -0,0 +1,205 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// C++0x [temp.arg.nontype] p5: +// The following conversions are performed on each expression used as +// a non-type template-argument. If a non-type template-argument cannot be +// converted to the type of the corresponding template-parameter then the +// program is ill-formed. +// -- for a non-type template-parameter of integral or enumeration type, +// integral promotions (4.5) and integral conversions (4.7) are applied. +namespace integral_parameters { + template struct X0 { }; + X0<17> x0i; + X0<'a'> x0c; + template struct X1 { }; + X1<100l> x1l; +} + +// -- for a non-type template-parameter of type pointer to object, +// qualification conversions (4.4) and the array-to-pointer conversion +// (4.2) are applied; if the template-argument is of type +// std::nullptr_t, the null pointer conversion (4.10) is applied. +namespace pointer_to_object_parameters { + // PR6226 + struct Str { + Str(const char *); + }; + + template + struct A { + Str get() { return s; } + }; + + char hello[6] = "Hello"; + extern const char world[6]; + const char world[6] = "world"; + void test() { + (void)A().get(); + (void)A().get(); + } + + class X { + public: + X(); + X(int, int); + operator int() const; + }; + + template struct A2; // expected-note{{template parameter is declared here}} + + X *X_ptr; + X an_X; + X array_of_Xs[10]; + A2 *a12; // expected-error{{must have its address taken}} + A2 *a13; + A2<&an_X> *a13_2; + A2<(&an_X)> *a13_3; // expected-warning{{address non-type template argument cannot be surrounded by parentheses}} + + // PR6244 + struct X1 {} X1v; + template struct X2 { }; + template struct X3 : X2 { }; + struct X4 : X3<&X1v> { }; + + // PR6563 + int *bar; + template struct zed {}; // expected-note 2{{template parameter is declared here}} + void g(zed*); // expected-error{{must have its address taken}} + + int baz; + void g2(zed*); // expected-error{{must have its address taken}} + + void g3(zed<&baz>*); // okay +} + +// -- For a non-type template-parameter of type reference to object, no +// conversions apply. The type referred to by the reference may be more +// cv-qualified than the (otherwise identical) type of the +// template-argument. The template-parameter is bound directly to the +// template-argument, which shall be an lvalue. +namespace reference_parameters { + template struct S0 { }; // expected-note 3 {{template parameter is declared here}} + template struct S1 { }; // expected-note 2 {{template parameter is declared here}} + template struct S2 { }; // expected-note 2 {{template parameter is declared here}} + template struct S3 { }; + int i; + extern const int ci; + volatile int vi; + extern const volatile int cvi; + void test() { + S0 s0; + S0 s0c; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'const int' ignores qualifiers}} + S0 s0v; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'volatile int' ignores qualifiers}} + S0 s0cv; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'const volatile int' ignores qualifiers}} + + S1 s1; + S1 s1c; + S1 s1v; // expected-error{{reference binding of non-type template parameter of type 'const int &' to template argument of type 'volatile int' ignores qualifiers}} + S1 s1cv; // expected-error{{reference binding of non-type template parameter of type 'const int &' to template argument of type 'const volatile int' ignores qualifiers}} + + S2 s2; + S2 s2c; // expected-error{{reference binding of non-type template parameter of type 'volatile int &' to template argument of type 'const int' ignores qualifiers}} + S2 s2v; + S2 s2cv; // expected-error{{reference binding of non-type template parameter of type 'volatile int &' to template argument of type 'const volatile int' ignores qualifiers}} + + S3 s3; + S3 s3c; + S3 s3v; + S3 s3cv; + } + + namespace PR6250 { + template void inc() { + ref++; // expected-error{{read-only variable is not assignable}} + } + + template void bind() { + T &ref2 = ref; // expected-error{{drops qualifiers}} + } + + int counter; + void test() { + inc(); // expected-note{{instantiation of}} + bind(); // expected-note{{instantiation of}} + } + } + + namespace PR6749 { + template struct foo {}; // expected-note{{template parameter is declared here}} + int x, &y = x; + foo f; // expected-error{{is not an object}} + } +} + +// -- For a non-type template-parameter of type pointer to function, the +// function-to-pointer conversion (4.3) is applied; if the +// template-argument is of type std::nullptr_t, the null pointer +// conversion (4.10) is applied. If the template-argument represents +// a set of overloaded functions (or a pointer to such), the matching +// function is selected from the set (13.4). +namespace pointer_to_function { + template struct X0 { }; // expected-note 3{{template parameter is declared here}} + int f(int); + int f(float); + int g(float); + int (*funcptr)(int); + void x0a(X0); + void x0b(X0<&f>); + void x0c(X0); // expected-error{{non-type template argument of type 'int (float)' cannot be converted to a value of type 'int (*)(int)'}} + void x0d(X0<&g>); // expected-error{{non-type template argument of type 'int (*)(float)' cannot be converted to a value of type 'int (*)(int)'}} + void x0e(X0); // expected-error{{must have its address taken}} +} + +// -- For a non-type template-parameter of type reference to function, no +// conversions apply. If the template-argument represents a set of +// overloaded functions, the matching function is selected from the set +// (13.4). +namespace reference_to_function { + template struct X0 { }; // expected-note 4{{template parameter is declared here}} + int f(int); + int f(float); + int g(float); + int (*funcptr)(int); + void x0a(X0); + void x0b(X0<&f>); // expected-error{{address taken in non-type template argument for template parameter of reference type 'int (&)(int)'}} + void x0c(X0); // expected-error{{non-type template parameter of reference type 'int (&)(int)' cannot bind to template argument of type 'int (float)'}} + void x0d(X0<&g>); // expected-error{{address taken in non-type template argument for template parameter of reference type 'int (&)(int)'}} + void x0e(X0); // expected-error{{non-type template parameter of reference type 'int (&)(int)' cannot bind to template argument of type 'int (*)(int)'}} +} +// -- For a non-type template-parameter of type pointer to member function, +// if the template-argument is of type std::nullptr_t, the null member +// pointer conversion (4.11) is applied; otherwise, no conversions +// apply. If the template-argument represents a set of overloaded member +// functions, the matching member function is selected from the set +// (13.4). +namespace pointer_to_member_function { + struct X { }; + struct Y : X { + int f(int); + int g(int); + int g(float); + float h(float); + }; + + template struct X0 {}; // expected-note{{template parameter is declared here}} + X0<&Y::f> x0a; + X0<&Y::g> x0b; + X0<&Y::h> x0c; // expected-error{{non-type template argument of type 'float (pointer_to_member_function::Y::*)(float)' cannot be converted to a value of type 'int (pointer_to_member_function::Y::*)(int)'}} +} + +// -- For a non-type template-parameter of type pointer to data member, +// qualification conversions (4.4) are applied; if the template-argument +// is of type std::nullptr_t, the null member pointer conversion (4.11) +// is applied. +namespace pointer_to_member_data { + struct X { int x; }; + struct Y : X { int y; }; + + template struct X0 {}; // expected-note{{template parameter is declared here}} + X0<&Y::y> x0a; + X0<&Y::x> x0b; // expected-error{{non-type template argument of type 'int pointer_to_member_data::X::*' cannot be converted to a value of type 'int pointer_to_member_data::Y::*'}} + + // Test qualification conversions + template struct X1 {}; + X1<&Y::y> x1a; +} diff --git a/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp b/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp new file mode 100644 index 0000000..1c13bff --- /dev/null +++ b/clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp @@ -0,0 +1,40 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s + +template struct eval; // expected-note 3{{template is declared here}} + +template