Steve Naroff | 2c0ccd0 | 2009-04-30 16:01:26 +0000 | [diff] [blame] | 1 | // RUN: clang-cc %s -fsyntax-only -verify |
2 | |||||
3 | // clang emits the following warning by default. | ||||
4 | // With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the | ||||
5 | // following warning. | ||||
6 | int t14() { | ||||
7 | return; // expected-warning {{non-void function 't14' should return a value}} | ||||
8 | } | ||||
9 | |||||
Steve Naroff | 940ab97 | 2009-04-30 17:53:16 +0000 | [diff] [blame^] | 10 | void t15() { |
11 | return 1; // expected-warning {{void function 't15' should not return a value}} | ||||
12 | } |