1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 2 3 // The nested-name-specifier of a qualified declarator-id shall not begin with a decltype-specifier. 4 class foo { 5 static int i; 6 void func(); 7 }; 8 9 int decltype(foo())::i; // expected-error{{'decltype' cannot be used to name a declaration}} 10 void decltype(foo())::func() { // expected-error{{'decltype' cannot be used to name a declaration}} 11 } 12 13 14 template<typename T> 15 class tfoo { 16 static int i; 17 void func(); 18 }; 19 20 template<typename T> 21 int decltype(tfoo<T>())::i; // expected-error{{nested name specifier 'decltype(tfoo<T>())::' for declaration does not refer into a class, class template or class template partial specialization}} 22 template<typename T> 23 void decltype(tfoo<T>())::func() { // expected-error{{nested name specifier 'decltype(tfoo<T>())::' for declaration does not refer into a class, class template or class template partial specialization}} 24 } 25