// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -triple x86_64-pc-win32
;
;
int __declspec
// expected-warning@-1 {{codeseg does not match previous declaration}}
// expected-note@3{{previous attribute is here}}
int __declspec
// expected-warning@-1 {{codeseg does not match previous declaration}}
// expected-note@8 {{previous attribute is here}}
int __declspec
// expected-warning@-1 {{codeseg does not match previous declaration}}
// expected-note@9 {{previous declaration is here}}
// Microsoft docs say:
// If a base-class has a code_seg attribute, derived classes must have the
// same attribute.
;
;
;
//expected-error@-1 {{derived class must specify the same code segment as its base classes}}
// expected-note@24 {{base class 'Base1' specified here}}
;
// expected-error@-1 {{derived class must specify the same code segment as its base classes}}
// expected-note@24 {{base class 'Base1' specified here}}
;
// expected-error@-1 {{derived class must specify the same code segment as its base classes}}
// expected-note@25 {{base class 'Base2' specified here}}
;
;
MB<Base1> mb1; // ok
MB<Base2> mb2;
// expected-error@37 {{derived class must specify the same code segment as its base classes}}
// expected-note@-2 {{in instantiation of template class}}
// expected-note@25 {{base class 'Base2' specified here}}
MD<Base1> md1;
// expected-error@38 {{derived class must specify the same code segment as its base classes}}
// expected-note@-2 {{in instantiation of template class}}
// expected-note@24 {{base class 'Base1' specified here}}
MD<Base2> md2;
// expected-error@38 {{derived class must specify the same code segment as its base classes}}
// expected-note@-2 {{in instantiation of template class}}
// expected-note@25 {{base class 'Base2' specified here}}
// Virtual overrides must have the same code_seg.
;
;
;
;
// MS gives an error when different code segments are used but a warning when a duplicate is used
// Function
int __declspec __declspec
// expected-warning@-1 {{duplicate code segment specifiers}}
int __declspec __declspec
// expected-error@-1 {{conflicting code segment specifiers}}
// Class
;
;
//Class Members
;