1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // Test that we properly merge the exclude_from_explicit_instantiation
4 // attribute on redeclarations.
6 #define EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((exclude_from_explicit_instantiation))
10 // Declaration without the attribute, definition with the attribute.
13 // Declaration with the attribute, definition without the attribute.
14 EXCLUDE_FROM_EXPLICIT_INSTANTIATION
void func2();
16 // Declaration with the attribute, definition with the attribute.
17 EXCLUDE_FROM_EXPLICIT_INSTANTIATION
void func3();
21 EXCLUDE_FROM_EXPLICIT_INSTANTIATION
void Foo
<T
>::func1() {
22 using Fail
= typename
T::invalid
; // expected-error{{no type named 'invalid' in 'Empty'}}
26 void Foo
<T
>::func2() {
27 using Fail
= typename
T::invalid
; // expected-error{{no type named 'invalid' in 'Empty'}}
31 EXCLUDE_FROM_EXPLICIT_INSTANTIATION
void Foo
<T
>::func3() {
32 using Fail
= typename
T::invalid
; // expected-error{{no type named 'invalid' in 'Empty'}}
36 extern template struct Foo
<Empty
>;
40 foo
.func1(); // expected-note{{in instantiation of}}
41 foo
.func2(); // expected-note{{in instantiation of}}
42 foo
.func3(); // expected-note{{in instantiation of}}