xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjCXX/instantiate-property-access.mm (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2*0a6a1f1dSLionel Sambuc// expected-no-diagnostics
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambucclass C {};
5*0a6a1f1dSLionel Sambucbool operator == (C c1, C c2);
6*0a6a1f1dSLionel Sambuc
7*0a6a1f1dSLionel Sambucbool operator == (C c1, int i);
8*0a6a1f1dSLionel Sambucbool operator == (int i, C c2);
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel SambucC operator += (C c1, C c2);
11*0a6a1f1dSLionel Sambuc
12*0a6a1f1dSLionel Sambucenum TextureType { TextureType3D  };
13*0a6a1f1dSLionel Sambuc
14*0a6a1f1dSLionel Sambuc@interface Texture
15*0a6a1f1dSLionel Sambuc@property  int textureType;
16*0a6a1f1dSLionel Sambuc@property  C c;
17*0a6a1f1dSLionel Sambuc@end
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuctemplate <typename> class Framebuffer {
20*0a6a1f1dSLionel Sambucpublic:
21*0a6a1f1dSLionel Sambuc  Texture **color_attachment;
22*0a6a1f1dSLionel Sambuc  Framebuffer();
23*0a6a1f1dSLionel Sambuc};
24*0a6a1f1dSLionel Sambuc
25*0a6a1f1dSLionel Sambuctemplate <typename T> Framebuffer<T>::Framebuffer() {
26*0a6a1f1dSLionel Sambuc  (void)(color_attachment[0].textureType == TextureType3D);
27*0a6a1f1dSLionel Sambuc  color_attachment[0].textureType += 1;
28*0a6a1f1dSLionel Sambuc  (void)(color_attachment[0].c == color_attachment[0].c);
29*0a6a1f1dSLionel Sambuc  (void)(color_attachment[0].c == 1);
30*0a6a1f1dSLionel Sambuc  (void)(1 == color_attachment[0].c);
31*0a6a1f1dSLionel Sambuc}
32*0a6a1f1dSLionel Sambuc
33*0a6a1f1dSLionel Sambucvoid foo() {
34*0a6a1f1dSLionel Sambuc  Framebuffer<int>();
35*0a6a1f1dSLionel Sambuc}
36