Hans Wennborg | 82dd877 | 2014-06-25 22:19:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i686-win32 -fms-compatibility -verify -std=c++11 %s |
David Majnemer | c28a964 | 2014-06-24 05:59:13 +0000 | [diff] [blame] | 2 | |
David Majnemer | 11a54c3 | 2014-06-24 06:40:51 +0000 | [diff] [blame] | 3 | extern int __attribute__((dllimport)) var; |
| 4 | constexpr int *varp = &var; // expected-error {{must be initialized by a constant expression}} |
| 5 | |
| 6 | extern __attribute__((dllimport)) void fun(); |
| 7 | constexpr void (*funp)(void) = &fun; // expected-error {{must be initialized by a constant expression}} |
David Majnemer | 0c43d80 | 2014-06-25 08:15:07 +0000 | [diff] [blame] | 8 | |
| 9 | template <void (*)()> |
| 10 | struct S {}; |
| 11 | S<&fun> x; |
| 12 | |
| 13 | template <int *> |
| 14 | struct U {}; |
| 15 | U<&var> y; |