p1-0x.cpp revision 76178ed0911797175b13ac733c390233f02bb841
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. 4class foo { 5 static int i; 6 void func(); 7}; 8 9int decltype(foo())::i; // expected-error{{'decltype' cannot be used to name a declaration}} 10void decltype(foo())::func() { // expected-error{{'decltype' cannot be used to name a declaration}} 11} 12 13 14template<typename T> 15class tfoo { 16 static int i; 17 void func(); 18}; 19 20template<typename T> 21int 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}} 22template<typename T> 23void 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