[cfe-commits] r148682 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprCXX.cpp test/SemaCXX/MicrosoftCompatibility.cpp

Nico Weber thakis at chromium.org
Sun Jan 22 22:14:19 PST 2012


> wouldn't you want to provide the source range to the microsoft-mode
> diagnostic too?

r148683, good catch.

>> +namespace PR11791 {
>> +  template<class _Ty>
>> +  void del(_Ty *_Ptr) {
>> +    _Ptr->~_Ty();  // expected-warning {{pseudo-destructors on type void are a Microsoft extension}}
>> +  }
>> +
>> +  void f() {
>> +    int* a = 0;
>> +    del((void*)a);  // expected-note {{in instantiation of function template specialization}}
>> +  }
>> +}
>
> This test case seems a bit more convoluted than necessary - would:
>
> typedef void *foo;
> foo f;
> f.~foo();
>
> suffice?

typedef void *foo;
foo f;
f->foo::~foo();

does suffice. The current test looks easier to understand to me
(pseudo-destructors were new to me), which is why I went with that.

Nico




More information about the cfe-commits mailing list