isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
projectRoot = "";
def warn_noreturn_function_has_return_expr : Warning<
"function %0 declared 'noreturn' should not return">,
InGroup<DiagGroup<"invalid-noreturn">>;
-def warn_noreturn_function_has_nonvoid_result : Warning<
- "%select{functions|blocks}0 declared 'noreturn' should have a 'void' result type">,
- InGroup<DiagGroup<"invalid-noreturn">>;
def warn_falloff_noreturn_function : Warning<
"function declared 'noreturn' should not return">,
InGroup<DiagGroup<"invalid-noreturn">>;
&& !Type->isMemberFunctionPointerType())
return true;
- if (!GetResultType(Type)->isVoidType()) {
- S.Diag(Attr.getLoc(), diag::warn_noreturn_function_has_nonvoid_result)
- << (Type->isBlockPointerType() ? /* blocks */ 1 : /* functions */ 0);
- }
-
// Otherwise we can process right away.
Type = S.Context.getNoReturnType(Type);
return false;
// was the block containing the merge for '?', which would trigger an
// assertion failure.
int rdar_7027684_aux();
-int rdar_7027684_aux_2() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+int rdar_7027684_aux_2() __attribute__((noreturn));
void rdar_7027684(int x, int y) {
{}; // this empty compound statement is critical.
(rdar_7027684_aux() ? rdar_7027684_aux_2() : (void) 0);
} // expected-warning {{function declared 'noreturn' should not return}}
// On K&R
-int f1() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+int f1() __attribute__((noreturn));
int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' only applies to function types; type here is 'int'}}
int sz8 = sizeof(^int (*[5])(long) {return funcptr3;}); // expected-error {{block declared as returning an array}}
void foo6() {
- int (^b)(int) __attribute__((noreturn)); // expected-warning{{blocks declared 'noreturn' should have a 'void' result type}}
+ int (^b)(int) __attribute__((noreturn));
b = ^ (int i) __attribute__((noreturn)) { return 1; }; // expected-error {{block declared 'noreturn' should not return}}
b(1);
- int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; // expected-error {{block declared 'noreturn' should not return}} expected-warning{{blocks declared 'noreturn' should have a 'void' result type}}
+ int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; // expected-error {{block declared 'noreturn' should not return}}
}
// This test case illustrates that we don't warn about the missing return
// because the function is marked noreturn and there is an infinite loop.
extern int foo_test_3();
-__attribute__((__noreturn__)) void* test3(int arg) { // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+__attribute__((__noreturn__)) void* test3(int arg) {
while (1) foo_test_3();
}
-__attribute__((__noreturn__)) void* test3_positive(int arg) { // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+__attribute__((__noreturn__)) void* test3_positive(int arg) {
while (0) foo_test_3();
} // expected-warning{{function declared 'noreturn' should not return}}
(void)(1 + unknown());
} // expected-warning {{control reaches end of non-void function}}
-int halt3() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+int halt3() __attribute__((noreturn));
int test9() {
(void)(halt3() + unknown());
// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value
-int halt() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+int halt() __attribute__((noreturn));
int live();
int dead();
class xpto {
- int blah() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+ int blah() __attribute__((noreturn));
};
int xpto::blah() {
// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks -Wunreachable-code -Wno-unused-value
-int &halt() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+int &halt() __attribute__((noreturn));
int &live();
int dead();
int liveti() throw(int);
struct S {
int mem;
} s;
- S &foor() __attribute__((noreturn)); // expected-warning{{functions declared 'noreturn' should have a 'void' result type}}
+ S &foor() __attribute__((noreturn));
foor()
.mem; // expected-warning {{will never be executed}}
}