Rafael Espindola | 4e31b4d | 2012-05-01 20:58:29 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | template <class Element> |
| 4 | void foo() { |
| 5 | } |
| 6 | template <> |
| 7 | __attribute__((visibility("hidden"))) // expected-note {{previous attribute is here}} |
| 8 | void foo<int>(); |
| 9 | |
| 10 | template <> |
| 11 | void foo<int>(); |
| 12 | |
| 13 | template <> |
| 14 | __attribute__((visibility("default"))) // expected-error {{visibility does not match previous declaration}} |
| 15 | void foo<int>() { |
| 16 | } |
Rafael Espindola | f729ce0 | 2012-07-12 04:32:30 +0000 | [diff] [blame] | 17 | |
| 18 | struct x3 { |
| 19 | static int y; |
| 20 | } __attribute((visibility("default"))); // expected-warning {{attribute 'visibility' after definition is ignored}} |