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