summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/attributes.cpp
blob: c578faba31a91f1b7d566202a37ba6ac48ca1d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %clang_cc1 -fsyntax-only -verify %s

template<int N>
struct X {
  struct __attribute__((__aligned__((N)))) Aligned { }; // expected-error{{'aligned' attribute requires integer constant}}

  int __attribute__((__address_space__(N))) *ptr; // expected-error{{attribute requires 1 argument(s)}}
};

namespace PR7102 {

  class NotTpl {
  public:
    union {
      char space[11];
      void* ptr;
    }  __attribute__((packed));
  };
  template<unsigned N>
  class Tpl {
  public:
    union {
      char space[N];
      void* ptr;
    }  __attribute__((packed));
  };

  int array[sizeof(NotTpl) == sizeof(Tpl<11>)? 1 : -1];
}
OpenPOWER on IntegriCloud