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). --- .../test/SemaTemplate/default-arguments-cxx0x.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 clang/test/SemaTemplate/default-arguments-cxx0x.cpp (limited to 'clang/test/SemaTemplate/default-arguments-cxx0x.cpp') diff --git a/clang/test/SemaTemplate/default-arguments-cxx0x.cpp b/clang/test/SemaTemplate/default-arguments-cxx0x.cpp new file mode 100644 index 0000000..7714313 --- /dev/null +++ b/clang/test/SemaTemplate/default-arguments-cxx0x.cpp @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s + +// Test default template arguments for function templates. +template +void f0(); + +template +void f0(); + +void g0() { + f0(); // okay! +} + +template +int &f1(T); + +float &f1(...); + +struct HasValue { + static const int value = 17; +}; + +void g1() { + float &fr = f1(15); + int &ir = f1(HasValue()); +} -- cgit v1.2.3