== DeclSpec::SCS_unspecified) {
QualType T = R->getAs<FunctionType>()->getResultType();
DeclaratorChunk &C = D.getTypeObject(0);
- if ((T->isDependentType() || T->isRecordType()) &&
- C.Fun.NumArgs == 0 && !C.Fun.isVariadic &&
+ if (!T->isVoidType() && C.Fun.NumArgs == 0 && !C.Fun.isVariadic &&
!C.Fun.TrailingReturnType &&
C.Fun.getExceptionSpecType() == EST_None) {
Diag(C.Loc, diag::warn_empty_parens_are_function_decl)
namespace test2 {
namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
void test0() {
- int foo(); // expected-note {{conflicting declaration}}
+ int foo(); // expected-note {{conflicting declaration}} expected-warning{{function declaration}}
using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
}
void test1() {
using ns::foo; //expected-note {{using declaration}}
- int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+ int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}} expected-warning{{function declaration}}
}
}
namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
class Test0 {
void test() {
- int foo(); // expected-note {{conflicting declaration}}
+ int foo(); // expected-note {{conflicting declaration}} expected-warning{{function declaration}}
using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
}
};
class Test1 {
void test() {
using ns::foo; //expected-note {{using declaration}}
- int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+ int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}} expected-warning{{function declaration}}
}
};
}
namespace ns { void foo(); } // expected-note 2 {{target of using declaration}}
template <typename> class Test0 {
void test() {
- int foo(); // expected-note {{conflicting declaration}}
+ int foo(); // expected-note {{conflicting declaration}} expected-warning{{function declaration}}
using ns::foo; // expected-error {{target of using declaration conflicts with declaration already in scope}}
}
};
template <typename> class Test1 {
void test() {
using ns::foo; //expected-note {{using declaration}}
- int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+ int foo(); // expected-error {{declaration conflicts with target of using declaration already in scope}} expected-warning{{function declaration}}
}
};
}
typedef int arr[10];
while (arr x=0) ; // expected-error {{an array type is not allowed here}} expected-error {{array initializer must be an initializer list}}
- while (int f()=0) ; // expected-error {{a function type is not allowed here}}
+ while (int f()=0) ; // expected-warning {{interpreted as a function declaration}} expected-error {{a function type is not allowed here}}
struct S {} s;
if (s) ++x; // expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}}
T(*d)(int(p)); // expected-warning {{parentheses were disambiguated as a function declarator}} expected-note {{previous definition is here}}
typedef T(*td)(int(p));
extern T(*tp)(int(p));
- S d3(); // expected-warning {{empty parentheses interpreted as a function declaration}}
- S d3v(void);
- typedef S d3t();
- extern S f3();
- __typeof(*T()) f4(); // expected-warning {{empty parentheses interpreted as a function declaration}}
- S multi1,
- multi2(); // expected-warning {{empty parentheses interpreted as a function declaration}}
+ T d3(); // expected-warning {{empty parentheses interpreted as a function declaration}}
+ typedef T d3t();
+ extern T f3();
T(d)[5]; // expected-error {{redefinition of 'd'}}
typeof(int[])(f) = { 1, 2 }; // expected-error {{extension used}}
void(b)(int);