From 9d24a8be93b28488dbfb9bbe8aa6fe35b21a5b0c Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Mon, 12 Dec 2011 23:24:39 +0000 Subject: Implement the Microsoft __if_exists/if_not_exists extension in initializer-list. Necessary to parse Microsoft ATL code. Example: int array[] = { 0, __if_exists(CLASS::Type) {2, } 3 }; will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146447 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/ms-if-exists.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/SemaTemplate/ms-if-exists.cpp') diff --git a/test/SemaTemplate/ms-if-exists.cpp b/test/SemaTemplate/ms-if-exists.cpp index 8ac4e2418c..04f4a63623 100644 --- a/test/SemaTemplate/ms-if-exists.cpp +++ b/test/SemaTemplate/ms-if-exists.cpp @@ -47,6 +47,12 @@ void f(T t) { int *i = t; // expected-error{{no viable conversion from 'HasFoo' to 'int *'}} { } } + + int array2[] = { + 0, + __if_exists(T::bar) {2, }// expected-warning{{dependent __if_exists declarations are ignored}} + 3 + }; } template void f(HasFoo); // expected-note{{in instantiation of function template specialization 'f' requested here}} -- cgit v1.2.3-70-g09d2