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/SemaCXX/redeclared-alias-template.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/SemaCXX/redeclared-alias-template.cpp (limited to 'clang/test/SemaCXX/redeclared-alias-template.cpp') diff --git a/clang/test/SemaCXX/redeclared-alias-template.cpp b/clang/test/SemaCXX/redeclared-alias-template.cpp new file mode 100644 index 0000000..09e9d0d --- /dev/null +++ b/clang/test/SemaCXX/redeclared-alias-template.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s + +template using A = int; // expected-note 2{{previous}} +template using A = char; // expected-error {{type alias template redefinition with different types ('char' vs 'int')}} +template using A = T1; // expected-error {{too many template parameters in template redeclaration}} + +template using B = T1; // expected-note {{previous}} +template using B = T1; // expected-error {{type alias template redefinition with different types}} + + +template struct S; +template class F> using FInt = F; +template using SXRInt = FInt::template R>; +template using SXRInt = typename S::template R; // ok, redeclaration. + +template class> struct TT; + +namespace FilterLookup { + TT f(); // expected-note {{previous declaration is here}} + + template using A = int; + TT f(); // expected-error {{functions that differ only in their return type cannot be overloaded}} +} -- cgit v1.2.3