Bug with decltype and scope operator

Bug with decltype and scope operator


I think I found a bug in the newest release of the Intel Compiler (Composer XE 2013 SP1 Update 1) on Windows; Namely the following code doesn't compile:

void f()
std::vector<int> v;
decltype(v)::iterator i;
int main()
return 0;

This code compiles succesfully with Visual C++, Clang 3.3 (on Linux) and gcc 4.8.2 (on linux).


2 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.


Yes this is something we just recently implemented in our development compiler.

This is the description of the change:

C++11: decltype allowed in nested-name-specifiers and destructor calls

The resolution of core issue 743, described in n3049, allowing decltype(expr)
to be used in a nested-name-specifier or following "~" in a destructor name is
now implemented.

  template <class T> struct A {
    struct B {};
  template <class T> inline void f(T t) {
    typename decltype(t)::B b;
    T *p = new T();
  int main() {
    A<int> a;

Sorry for the inconvenience.


Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui