Change function declaration to be prototyped. (#182)

With the introduction of type variable types in clang, it is important to make sure that generic functions are a FunctionProtoType. We did not allow generic functions to be FunctionNoProtoType. In order for the tests to work correctly, I had to add "void" in () if there are no parameters.
This commit is contained in:
Jay Lim 2017-07-11 13:26:18 -07:00 коммит произвёл GitHub
Родитель 4d9dc92673
Коммит bc6a06e773
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -10,7 +10,7 @@
// expected-no-diagnostics
// Testing for function declaration with function body, without parameters.
_For_any(T) T TestDefinitionWithNoParameter() {
_For_any(T) T TestDefinitionWithNoParameter(void) {
// Testing the scope created by forany specifier contains function body scope
T returnVal;
return returnVal;
@ -23,7 +23,7 @@ _For_any(T, S) T TestDefinitionWithParameter(T at, T bt, S cs) {
}
// Testing for function declaration without function body, without parameters.
_For_any(R) R TestDeclarationWithNoParameter();
_For_any(R) R TestDeclarationWithNoParameter(void);
// Testing for function declaration without function body, with parameters
_For_any(Q) Q TestDeclarationWithParameter(Q aq, Q bq, Q cq);

Просмотреть файл

@ -8,9 +8,9 @@
//
// RUN: %clang_cc1 -fcheckedc-extension -verify %s
_For_any(R) R foo();
_For_any(R) R foo(void);
// Testing scope created by for any specifier is exited successfully.
R thisShouldProduceError; //expected-error{{unknown type name 'R'}}
_For_any() void foo2(); // expected-error{{expected type variable identifier}}
_For_any(R, ) R foo3(); // expected-error{{expected type variable identifier}}
_For_any(R T) R foo4(); // expected-error{{expected , or )}}
_For_any() void foo2(void); // expected-error{{expected type variable identifier}}
_For_any(R, ) R foo3(void); // expected-error{{expected type variable identifier}}
_For_any(R T) R foo4(void); // expected-error{{expected , or )}}