2015-09-30 21:32:42 +08:00
|
|
|
// RUN: clang-tidy -checks='-*,modernize-use-override' %s.nonexistent.cpp -- | FileCheck -check-prefix=CHECK1 -implicit-check-not='{{warning:|error:}}' %s
|
|
|
|
// RUN: clang-tidy -checks='-*,clang-diagnostic-*,google-explicit-constructor' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK2 -implicit-check-not='{{warning:|error:}}' %s
|
|
|
|
// RUN: clang-tidy -checks='-*,google-explicit-constructor,clang-diagnostic-literal-conversion' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK3 -implicit-check-not='{{warning:|error:}}' %s
|
|
|
|
// RUN: clang-tidy -checks='-*,modernize-use-override,clang-diagnostic-macro-redefined' %s -- -DMACRO_FROM_COMMAND_LINE | FileCheck -check-prefix=CHECK4 -implicit-check-not='{{warning:|error:}}' %s
|
2014-03-20 17:38:22 +08:00
|
|
|
|
2014-07-02 23:05:04 +08:00
|
|
|
// CHECK1: error: error reading '{{.*}}.nonexistent.cpp' [clang-diagnostic-error]
|
|
|
|
// CHECK2: error: unknown argument: '-fan-unknown-option' [clang-diagnostic-error]
|
2015-09-30 21:32:42 +08:00
|
|
|
// CHECK3: error: unknown argument: '-fan-unknown-option' [clang-diagnostic-error]
|
2014-03-20 17:38:22 +08:00
|
|
|
|
2014-07-17 18:05:26 +08:00
|
|
|
// CHECK2: :[[@LINE+2]]:9: warning: implicit conversion from 'double' to 'int' changes value from 1.5 to 1 [clang-diagnostic-literal-conversion]
|
2014-03-20 17:38:22 +08:00
|
|
|
// CHECK3: :[[@LINE+1]]:9: warning: implicit conversion from 'double' to 'int' changes value
|
|
|
|
int a = 1.5;
|
|
|
|
|
2015-11-28 10:25:02 +08:00
|
|
|
// CHECK2: :[[@LINE+2]]:11: warning: single-argument constructors must be marked explicit
|
|
|
|
// CHECK3: :[[@LINE+1]]:11: warning: single-argument constructors must be marked explicit
|
2014-03-20 17:38:22 +08:00
|
|
|
class A { A(int) {} };
|
|
|
|
|
2014-05-06 16:10:00 +08:00
|
|
|
#define MACRO_FROM_COMMAND_LINE
|
|
|
|
// CHECK4: :[[@LINE-1]]:9: warning: 'MACRO_FROM_COMMAND_LINE' macro redefined
|