当调用类的析构函数时,编译器是否应该推断模板参数?以下代码:
#include <iostream>
template <typename T>
class A{
};
int main(){
A<int> * a = new A<int>();
a->~A();
}
在 gcc (g++ 4.3.4) 上编译良好,但在 XLC++ 上失败
line 30.5: 1540-0210 (S) "A" is not a base class of
"A<int>"
符合标准的编译器期望这两种行为中的哪一种?