Unnamed: 0
int64
0
0
repo_id
stringlengths
5
186
file_path
stringlengths
15
223
content
stringlengths
1
32.8M
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-ext_vector1.h
// First header file for chain-ext_vector.c PCH test typedef __attribute__((ext_vector_type(2))) float float2;
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-remap-types1.h
@class X; struct Y { X *my_X; }; @interface X { } @property X *prop; @end
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/arc.h
// Header for Objective-C ARC-related PCH tests typedef const void *CFTypeRef; typedef const struct __CFString *CFStringRef; CFTypeRef CFCreateSomething(); CFStringRef CFCreateString(); CFTypeRef CFGetSomething(); CFStringRef CFGetString(); @interface NSString @end id CreateSomething(); NSString *CreateNSString(); #if __has_feature(objc_arc) #define BRIDGE __bridge #else #define BRIDGE #endif typedef int array0[sizeof((BRIDGE id)CFCreateSomething())]; typedef int array1[sizeof((BRIDGE CFTypeRef)CreateSomething())];
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-external-defs1.h
// Helper 1 for chain-external-defs.c test // Tentative definitions int x; int x2; // Should not show up static int z; int incomplete_array[]; int incomplete_array2[]; struct S s;
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-macro-override2.h
#define f() g() #undef g #undef h #define h() g() int x; #undef h2 int h3();
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/cxx11-statement-attributes.h
// To be used with cxx11-statement-attributes.cpp. template<const int N> int f(int n) { switch (n * N) { case 0: n += 15; [[clang::fallthrough]]; // This shouldn't generate a warning. case 1: n += 20; [[clang::fallthrough]]; // This should generate a warning: "fallthrough annotation does not directly precede switch label". break; } return n; }
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/case-insensitive-include.h
#pragma once struct S { int x; };
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-decls2.h
void g(); struct two {}; void one(); struct three {}; // for verification void many(int k); struct many; void many(int l); struct many {}; void noret() __attribute__((noreturn));
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-decls1.h
void f(); struct one {}; void two(); void many(int i); struct many; void many(int j); struct many; void noret();
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-macro1.h
#define FOOBAR void f();
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/working-directory-1.h
template<typename T> struct A { A() { int a; } };
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-macro-override1.h
void f() __attribute__((unavailable)); void g(); #define g() f() #define h() f() #define x x #define h2() f() #define h3() #undef h3
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-macro2.h
#define BARFOO void g();
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/namespaces.h
// Header for PCH test namespaces.cpp namespace N1 { typedef int t1; } namespace N1 { typedef int t2; void used_func(); struct used_cls { }; } namespace N2 { typedef float t1; namespace Inner { typedef int t3; }; } namespace { void anon() { } class C; } namespace N3 { namespace { class C; } } namespace Alias1 = N2::Inner; using namespace N2::Inner; extern "C" { void ext(); } inline namespace N4 { struct MemberOfN4; }
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-selectors2.h
@interface Y -(void)f; -(void)f2; -(void)x; -(void)y; -(void)e; @end void foo2() { // FIXME: Can't verify warnings in headers //(void)@selector(y); //(void)@selector(e); } @interface X (Blarg) - (void)blarg_method; @end
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-remap-types2.h
void h(X*); @interface X (Blah) { } @end void g(X*);
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/typo.hpp
namespace boost { template<typename F> class function {}; namespace graph { template<typename V, typename E> class adjacency_list { }; }; }
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/va_arg.h
#include <stdarg.h>
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/cuda.h
/* Minimal declarations for CUDA support. Testing purposes only. */ #include <stddef.h> #define __constant__ __attribute__((constant)) #define __device__ __attribute__((device)) #define __global__ __attribute__((global)) #define __host__ __attribute__((host)) #define __shared__ __attribute__((shared)) #define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__))) struct dim3 { unsigned x, y, z; __host__ __device__ dim3(unsigned x, unsigned y = 1, unsigned z = 1) : x(x), y(y), z(z) {} }; typedef struct cudaStream *cudaStream_t; int cudaConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0, cudaStream_t stream = 0);
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-selectors1.h
@interface X -(void)f; -(void)f2; -(void)g:(int)p; -(void)h:(int)p1 foo:(int)p2; @end void foo1() { // FIXME: Can't verify warnings in headers //(void)@selector(x); (void)@selector(f); } @interface X (Blah) - (void)blah_method; @end
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-ext_vector2.h
// Second header file for chain-ext_vector.c PCH test typedef __attribute__((ext_vector_type(4))) float float4;
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/cxx-method.h
struct S { void m(int x); S(); S(const S&); operator const char*(); operator char*(); };
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/__va_list_tag.h
// Header for PCH test __va_list_tag.h typedef __builtin_va_list va_list; extern int myvfprintf(const char * , va_list);
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/typo.h
@interface NSString + (id)alloc; @end
0
repos/DirectXShaderCompiler/tools/clang/test/PCH
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/chain-external-defs2.h
// Helper 2 for chain-external-defs.c test // Tentative definitions int y; int y2; // Should still not show up static int z; int incomplete_array[]; int incomplete_array3[];
0
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/modules/Foo.h
void make_foo(void);
0
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs
repos/DirectXShaderCompiler/tools/clang/test/PCH/Inputs/modules/module.modulemap
module Foo { header "Foo.h" }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-stmt.c
// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s int TestLocation = 0; // CHECK: VarDecl{{.*}}TestLocation // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:20> 'int' 0 int TestIndent = 1 + (1); // CHECK: VarDecl{{.*}}TestIndent // CHECK-NEXT: {{^}}`-BinaryOperator{{[^()]*$}} // CHECK-NEXT: {{^}} |-IntegerLiteral{{.*0[^()]*$}} // CHECK-NEXT: {{^}} `-ParenExpr{{.*0[^()]*$}} // CHECK-NEXT: {{^}} `-IntegerLiteral{{.*0[^()]*$}} void TestDeclStmt() { int x = 0; int y, z; } // CHECK: FunctionDecl{{.*}}TestDeclStmt // CHECK-NEXT: CompoundStmt // CHECK-NEXT: DeclStmt // CHECK-NEXT: VarDecl{{.*}}x // CHECK-NEXT: IntegerLiteral // CHECK-NEXT: DeclStmt // CHECK-NEXT: VarDecl{{.*}}y // CHECK-NEXT: VarDecl{{.*}}z int TestOpaqueValueExpr = 0 ?: 1; // CHECK: VarDecl{{.*}}TestOpaqueValueExpr // CHECK-NEXT: BinaryConditionalOperator // CHECK-NEXT: IntegerLiteral // CHECK-NEXT: OpaqueValueExpr // CHECK-NEXT: IntegerLiteral // CHECK-NEXT: OpaqueValueExpr // CHECK-NEXT: IntegerLiteral // CHECK-NEXT: IntegerLiteral
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-stmt.cpp
// RUN: %clang_cc1 -fcxx-exceptions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s namespace n { void function() {} int Variable; } using n::function; using n::Variable; void TestFunction() { void (*f)() = &function; // CHECK: DeclRefExpr{{.*}} (UsingShadow{{.*}}function Variable = 4; // CHECK: DeclRefExpr{{.*}} (UsingShadow{{.*}}Variable } // CHECK: FunctionDecl {{.*}} TestCatch1 void TestCatch1() { // CHECK: CXXTryStmt // CHECK-NEXT: CompoundStmt try { } // CHECK-NEXT: CXXCatchStmt // CHECK-NEXT: VarDecl {{.*}} x // CHECK-NEXT: CompoundStmt catch (int x) { } } // CHECK: FunctionDecl {{.*}} TestCatch2 void TestCatch2() { // CHECK: CXXTryStmt // CHECK-NEXT: CompoundStmt try { } // CHECK-NEXT: CXXCatchStmt // CHECK-NEXT: NULL // CHECK-NEXT: CompoundStmt catch (...) { } } void TestAllocationExprs() { int *p; p = new int; delete p; p = new int[2]; delete[] p; p = ::new int; ::delete p; } // CHECK: FunctionDecl {{.*}} TestAllocationExprs // CHECK: CXXNewExpr {{.*}} 'int *' Function {{.*}} 'operator new' // CHECK: CXXDeleteExpr {{.*}} 'void' Function {{.*}} 'operator delete' // CHECK: CXXNewExpr {{.*}} 'int *' array Function {{.*}} 'operator new[]' // CHECK: CXXDeleteExpr {{.*}} 'void' array Function {{.*}} 'operator delete[]' // CHECK: CXXNewExpr {{.*}} 'int *' global Function {{.*}} 'operator new' // CHECK: CXXDeleteExpr {{.*}} 'void' global Function {{.*}} 'operator delete' // Don't crash on dependent exprs that haven't been resolved yet. template <typename T> void TestDependentAllocationExpr() { T *p = new T; delete p; } // CHECK: FunctionTemplateDecl {{.*}} TestDependentAllocationExpr // CHECK: CXXNewExpr {{.*'T \*'$}} // CHECK: CXXDeleteExpr {{.*'void'$}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/dev-fd-fs.c
// Check that we can operate on files from /dev/fd. // REQUIRES: dev-fd-fs // Check reading from named pipes. We cat the input here instead of redirecting // it to ensure that /dev/fd/0 is a named pipe, not just a redirected file. // // RUN: cat %s | %clang -x c /dev/fd/0 -E > %t // RUN: FileCheck --check-prefix DEV-FD-INPUT < %t %s // // DEV-FD-INPUT: int x; // Check writing to /dev/fd named pipes. We use cat here as before to ensure we // get a named pipe. // // RUN: %clang -x c %s -E -o /dev/fd/1 | cat > %t // RUN: FileCheck --check-prefix DEV-FD-FIFO-OUTPUT < %t %s // // DEV-FD-FIFO-OUTPUT: int x; // Check writing to /dev/fd regular files. // // RUN: %clang -x c %s -E -o /dev/fd/1 > %t // RUN: FileCheck --check-prefix DEV-FD-REG-OUTPUT < %t %s // // DEV-FD-REG-OUTPUT: int x; int x;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-frontend.c
// RUN: rm -f %t // RUN: %clang -fsyntax-only %s -Wblahblah --serialize-diagnostics %t > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s // This test case tests that we can handle frontend diagnostics. // CHECK: warning: unknown warning option '-Wblahblah' // CHECK: Number of diagnostics: 1
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/unnecessary-elipses.cpp
// RUN: %clang_cc1 -fsyntax-only -fmessage-length 80 %s 2>&1 | FileCheck -strict-whitespace %s int main() { "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // CHECK: {{^ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";}} "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // CHECK: {{^ ..."xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";}} "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; // CHECK: {{^"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"...}} "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; // CHECK: {{^ ..."xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"...}} }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/predefines.c
/* RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding -pedantic-errors %s * expected-no-diagnostics * rdar://6814950 */ #include <stdint.h>
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-no-issue.c
void foo(); // RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t // RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s // RUN: rm -f %t // NOTE: it is important that this test case contains no issues. It tests // that serialize diagnostics work in the absence of any issues. // CHECK: Number of diagnostics: 0
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/error-limit.c
// RUN: not %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s // error and note emitted struct s1{}; struct s1{}; // error and note suppressed by error-limit struct s2{}; struct s2{}; // CHECK: 5:8: error: redefinition of 's1' // CHECK: 4:8: note: previous definition is here // CHECK: fatal error: too many errors emitted, stopping now // CHECK-NOT: 9:8: error: redefinition of 's2' // CHECK-NOT: 8:8: note: previous definition is here
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-trailing-null-bytes.cpp
// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s // CHECK: {{ERR_DNS_SERVER_REQUIRES_TCP$}} // http://llvm.org/PR12674 #define NET_ERROR(label, value) ERR_ ## label = value, NET_ERROR(DNS_SERVER_REQUIRES_TCP, -801) #undef NET_ERROR
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warn-in-system-header.h
#warning the cake is a lie
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/remap-file.c
// RUN: %clang_cc1 -remap-file "%s;%S/Inputs/remapped-file" -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXIST %s // RUN: %clang_cc1 -remap-file "%S/nonexistent.c;%S/Inputs/remapped-file" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-NONEXIST %s // RUN: %clang_cc1 -remap-file "%S/nonexistent.c;%S/Inputs/remapped-file-2" -remap-file "%S/nonexistent.h;%S/Inputs/remapped-file-3" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-HEADER %s // CHECK-EXIST: remap-file.c:1:28: warning: incompatible pointer types // CHECK-NONEXIST: nonexistent.c:1:28: warning: incompatible pointer types // CHECK-HEADER: nonexistent.c:3:19: warning: incompatible pointer types int
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags.h
// This file intentionally has a bug. It is intended // to be used with serialized-diagnostics.c to show // how errors are handled with #includes in serialized // diagnostics. char *badStr = 1;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warning-flags-enabled.c
// RUN: diagtool show-enabled %s | FileCheck %s // // This shows warnings which are on by default. // We just check a few to make sure it's doing something sensible. // // CHECK: ext_unterminated_string // CHECK: warn_condition_is_assignment // CHECK: warn_null_arg // RUN: diagtool show-enabled -Wno-everything %s | count 0 // RUN: diagtool show-enabled -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-WARN %s // RUN: diagtool show-enabled -Wno-everything -Werror=objc-root-class %s | FileCheck -check-prefix CHECK-ERROR %s // RUN: diagtool show-enabled -Wno-everything -Wfatal-errors=objc-root-class %s | FileCheck -check-prefix CHECK-FATAL %s // // CHECK-WARN: W warn_objc_root_class_missing [-Wobjc-root-class] // CHECK-ERROR: E warn_objc_root_class_missing [-Wobjc-root-class] // CHECK-FATAL: F warn_objc_root_class_missing [-Wobjc-root-class] // RUN: diagtool show-enabled --no-levels -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-NO-LEVELS %s // // CHECK-NO-LEVELS-NOT: W // CHECK-NO-LEVELS-NOT: E // CHECK-NO-LEVELS-NOT: F // CHECK-NO-LEVELS: warn_objc_root_class_missing [-Wobjc-root-class] // Test if EnumConversion is a subgroup of -Wconversion. // RUN: diagtool show-enabled --no-levels -Wno-conversion -Wenum-conversion %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s // RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s // RUN: diagtool show-enabled --no-levels -Wno-conversion %s | FileCheck --check-prefix CHECK-NO-ENUM-CONVERSION %s // // CHECK-ENUM-CONVERSION: -Wenum-conversion // CHECK-NO-ENUM-CONVERSION-NOT: -Wenum-conversion // Test if -Wshift-op-parentheses is a subgroup of -Wparentheses // RUN: diagtool show-enabled --no-levels -Wno-parentheses -Wshift-op-parentheses %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s // RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s // RUN: diagtool show-enabled --no-levels -Wno-parentheses %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s // // CHECK-SHIFT-OP-PARENTHESES: -Wshift-op-parentheses // CHECK-NO-SHIFT-OP-PARENTHESES-NOT: -Wshift-op-parentheses
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warn-in-system-header.c
// RUN: %clang_cc1 -isystem %S %s -fsyntax-only -verify #include <warn-in-system-header.h> // [email protected]:4 {{the cake is a lie}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-comment.cpp
// RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s /// Aaa int TestLocation; // CHECK: VarDecl{{.*}}TestLocation // CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7> /// int TestIndent; // CHECK: {{^VarDecl.*TestIndent[^()]*$}} // CHECK-NEXT: {{^`-FullComment.*>$}} /// Aaa int Test_TextComment; // CHECK: VarDecl{{.*}}Test_TextComment // CHECK-NEXT: FullComment // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" Aaa" /// \brief Aaa int Test_BlockCommandComment; // CHECK: VarDecl{{.*}}Test_BlockCommandComment // CHECK: BlockCommandComment{{.*}} Name="brief" // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" Aaa" /// \param Aaa xxx /// \param [in,out] Bbb yyy void Test_ParamCommandComment(int Aaa, int Bbb); // CHECK: FunctionDecl{{.*}}Test_ParamCommandComment // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0 // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" xxx" // CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1 // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" yyy" /// \tparam Aaa xxx template <typename Aaa> class Test_TParamCommandComment; // CHECK: ClassTemplateDecl{{.*}}Test_TParamCommandComment // CHECK: TParamCommandComment{{.*}} Param="Aaa" Position=<0> // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" xxx" /// \c Aaa int Test_InlineCommandComment; // CHECK: VarDecl{{.*}}Test_InlineCommandComment // CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa" /// <a>Aaa</a> /// <br/> int Test_HTMLTagComment; // CHECK: VarDecl{{.*}}Test_HTMLTagComment // CHECK-NEXT: FullComment // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" " // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a" // CHECK-NEXT: TextComment{{.*}} Text="Aaa" // CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a" // CHECK-NEXT: TextComment{{.*}} Text=" " // CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing /// \verbatim /// Aaa /// \endverbatim int Test_VerbatimBlockComment; // CHECK: VarDecl{{.*}}Test_VerbatimBlockComment // CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim" // CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa" /// \param ... More arguments template<typename T> void Test_TemplatedFunctionVariadic(int arg, ...); // CHECK: FunctionTemplateDecl{{.*}}Test_TemplatedFunctionVariadic // CHECK: ParamCommandComment{{.*}} [in] implicitly Param="..." // CHECK-NEXT: ParagraphComment // CHECK-NEXT: TextComment{{.*}} Text=" More arguments"
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/backend-optimization-failure-nodbg.cpp
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -O3 -emit-llvm -S -verify -o /dev/null // REQUIRES: x86-registered-target // Test verifies optimization failures generated by the backend are handled // correctly by clang. LLVM tests verify all of the failure conditions. void test_switch(int *A, int *B, int Length) { #pragma clang loop vectorize(enable) unroll(disable) for (int i = 0; i < Length; i++) { switch (A[i]) { case 0: B[i] = 1; break; case 1: B[i] = 2; break; default: B[i] = 3; } } /* expected-warning {{loop not vectorized: failed explicitly specified loop vectorization}} */ }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warning-flags-tree.c
// RUN: diagtool tree | FileCheck -strict-whitespace %s // RUN: diagtool tree -Weverything | FileCheck -strict-whitespace %s // RUN: diagtool tree everything | FileCheck -strict-whitespace %s // // These three ways of running diagtool tree are the same: // they produce a tree for every top-level diagnostic flag. // Just check a few to make sure we're actually showing more than one group. // // CHECK: -W // CHECK: -Wextra // CHECK: -Wmissing-field-initializers // CHECK: warn_missing_field_initializers // CHECK: -Wall // CHECK: -Wmost // These flags are currently unimplemented; test that we output them anyway. // CHECK: -Wstrict-aliasing // CHECK-NEXT: -Wstrict-aliasing=0 // CHECK-NEXT: -Wstrict-aliasing=1 // CHECK-NEXT: -Wstrict-aliasing=2 // CHECK: -Wstrict-overflow // CHECK-NEXT: -Wstrict-overflow=0 // CHECK-NEXT: -Wstrict-overflow=1 // CHECK-NEXT: -Wstrict-overflow=2 // CHECK-NEXT: -Wstrict-overflow=3 // CHECK-NEXT: -Wstrict-overflow=4 // CHECK-NEXT: -Wstrict-overflow=5 // RUN: not diagtool tree -Wthis-is-not-a-valid-flag // RUN: diagtool tree -Wgnu | FileCheck -strict-whitespace -check-prefix CHECK-GNU %s // CHECK-GNU: -Wgnu // CHECK-GNU: -Wgnu-designator // CHECK-GNU: ext_gnu_array_range // CHECK-GNU: ext_gnu_missing_equal_designator // CHECK-GNU: ext_gnu_old_style_field_designator // CHECK-GNU: -Wvla-extension // CHECK-GNU: ext_vla // There are more GNU extensions but we don't need to check them all. // RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s // CHECK-FLAGS-ONLY: -Wgnu // CHECK-FLAGS-ONLY: -Wgnu-designator // CHECK-FLAGS-ONLY-NOT: ext_gnu_array_range // CHECK-FLAGS-ONLY-NOT: ext_gnu_missing_equal_designator // CHECK-FLAGS-ONLY-NOT: ext_gnu_old_style_field_designator // CHECK-FLAGS-ONLY: -Wvla // CHECK-FLAGS-ONLY-NOT: ext_vla // CHECK-FLAGS-ONLY-NOT: ext_array_init_copy // CHECK-FLAGS-ONLY-NOT: ext_empty_struct_union // CHECK-FLAGS-ONLY-NOT: ext_expr_not_ice
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-verify.cpp
// RUN: not %clang_cc1 -fsyntax-only -verify %s 2>&1 | FileCheck %s // Test the -verify flag. Each of the "x = y;" lines will produce a // "use of undeclared identifier 'y'" error message. void test() { int x; // Proper matches here. x = y; // expected-error{{use of undeclared identifier 'y'}} x = y; // expected-error{{use of undeclared identifier}} x = y; // expected-error{{undeclared identifier 'y'}} x = y; // expected-error{{use of}} x = y; // expected-error{{undeclared identifier}} x = y; // expected-error{{'y'}} // Bad matches here. x = y; // expected-error{{use of undeclared identifier 'y' is fine}} x = y; // expected-error{{abuse of undeclared identifier 'y'}} x = y; // expected-error{{good use of undeclared identifier 'y' in code}} x = y; // expected-error{{ use of undeclared identifier 'y' }} x = y; // expected-error{{use of undeclared identifier 'y' is disallowed}} x = y; // expected-error{{please don't use of undeclared identifier 'y'}} x = y; // expected-error{{use of undeclared identifier 'y'; please declare y before use}} x = y; // expected-error{{use of use of undeclared identifier 'y'}} x = y; // expected-error{{use of undeclared identifier 'y' identifier 'y'}} } //CHECK: error: 'error' diagnostics expected but not seen: //CHECK: Line 17: use of undeclared identifier 'y' is fine //CHECK: Line 18: abuse of undeclared identifier 'y' //CHECK: Line 19: good use of undeclared identifier 'y' in code //CHECK: Line 20: use of undeclared identifier 'y' //CHECK: Line 21: use of undeclared identifier 'y' is disallowed //CHECK: Line 22: please don't use of undeclared identifier 'y' //CHECK: Line 23: use of undeclared identifier 'y'; please declare y before use //CHECK: Line 24: use of use of undeclared identifier 'y' //CHECK: Line 25: use of undeclared identifier 'y' identifier 'y' //CHECK: error: 'error' diagnostics seen but not expected: //CHECK: Line 17: use of undeclared identifier 'y' //CHECK: Line 18: use of undeclared identifier 'y' //CHECK: Line 19: use of undeclared identifier 'y' //CHECK: Line 20: use of undeclared identifier 'y' //CHECK: Line 21: use of undeclared identifier 'y' //CHECK: Line 22: use of undeclared identifier 'y' //CHECK: Line 23: use of undeclared identifier 'y' //CHECK: Line 24: use of undeclared identifier 'y' //CHECK: Line 25: use of undeclared identifier 'y' //CHECK: 18 errors generated.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/win32-macho.c
// Check that basic use of win32-macho targets works. // RUN: %clang -fsyntax-only -target x86_64-pc-win32-macho %s
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-invalid.cpp
// RUN: not %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s namespace TestInvalidRParenOnCXXUnresolvedConstructExpr { template <class T> void f(T i, T j) { return T (i, j; } } // CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidRParenOnCXXUnresolvedConstructExpr // CHECK-NEXT: `-FunctionTemplateDecl // CHECK-NEXT: |-TemplateTypeParmDecl // CHECK-NEXT: `-FunctionDecl // CHECK-NEXT: |-ParmVarDecl // CHECK-NEXT: |-ParmVarDecl // CHECK-NEXT: `-CompoundStmt // CHECK-NEXT: `-ReturnStmt // CHECK-NEXT: `-CXXUnresolvedConstructExpr {{.*}} <col:10, col:16> 'T' // CHECK-NEXT: |-DeclRefExpr {{.*}} <col:13> 'T' lvalue ParmVar {{.*}} 'i' 'T' // CHECK-NEXT: `-DeclRefExpr {{.*}} <col:16> 'T' lvalue ParmVar {{.*}} 'j' 'T'
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/attr-source-range.cpp
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s void f(int i) __attribute__((format_arg(1))); // CHECK: attr-source-range.cpp:3:30:{3:41-3:42}{3:8-3:13} void g(int i, ...) __attribute__((format(printf, 1, 1))); // CHECK: attr-source-range.cpp:6:35:{6:50-6:51}{6:8-6:13} int h(void) __attribute__((returns_nonnull)); // CHECK: attr-source-range.cpp:9:28:{9:1-9:4} void i(int j) __attribute__((nonnull(1))); // CHECK: attr-source-range.cpp:12:30:{12:38-12:39}{12:8-12:13} void j(__attribute__((nonnull)) int i); // CHECK: attr-source-range.cpp:15:23:{15:8-15:38}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-print-pragmas.cpp
// RUN: %clang_cc1 -ast-print %s -o - | FileCheck %s // FIXME: A bug in ParsedAttributes causes the order of the attributes to be // reversed. The checks are consequently in the reverse order below. // CHECK: #pragma clang loop interleave_count(8) // CHECK-NEXT: #pragma clang loop vectorize_width(4) void test(int *List, int Length) { int i = 0; #pragma clang loop vectorize_width(4) #pragma clang loop interleave_count(8) // CHECK-NEXT: while (i < Length) while (i < Length) { List[i] = i * 2; i++; } // CHECK: #pragma clang loop interleave(disable) // CHECK-NEXT: #pragma clang loop vectorize(enable) #pragma clang loop vectorize(enable) #pragma clang loop interleave(disable) // CHECK-NEXT: while (i - 1 < Length) while (i - 1 < Length) { List[i] = i * 2; i++; } // CHECK: #pragma clang loop interleave(enable) // CHECK-NEXT: #pragma clang loop vectorize(disable) #pragma clang loop vectorize(disable) #pragma clang loop interleave(enable) // CHECK-NEXT: while (i - 2 < Length) while (i - 2 < Length) { List[i] = i * 2; i++; } } template <int V, int I> void test_nontype_template_param(int *List, int Length) { #pragma clang loop vectorize_width(V) interleave_count(I) for (int i = 0; i < Length; i++) { List[i] = i; } } // CHECK: #pragma clang loop interleave_count(I) // CHECK: #pragma clang loop vectorize_width(V) void test_templates(int *List, int Length) { test_nontype_template_param<2, 4>(List, Length); }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/freebsd-arm-size_t.c
// RUN: %clang_cc1 -triple arm-unknown-freebsd10.0 -verify %s // expected-no-diagnostics /* Define a size_t as expected for FreeBSD ARM */ typedef unsigned int size_t; /* Declare a builtin function that uses size_t */ void *malloc(size_t);
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diagnostic-crash.cpp
// RUN: %clang_cc1 -verify -fsyntax-only %s // The diagnostics we produce for this code tickled a bug in raw_ostream. template <typename _Alloc> class allocator; template <class _CharT> struct char_traits; template <typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string; typedef basic_string<wchar_t> wstring; class Closure { }; template <class A1> class Callback1 { }; template <class A1, class A2> class Callback2 { }; template <class R, class A2> class ResultCallback1 { }; template <bool del, class R, class T, class P1, class P2, class A1> class AAAAAAAResultCallback_2_1 : public ResultCallback1<R, A1> { }; template <bool del, class T, class P1, class P2, class A1> class AAAAAAAResultCallback_2_1< del, void, T, P1, P2, A1> : public Callback1<A1> { public: typedef Callback1<A1> base; }; template <class T1, class T2, class R, class P1, class P2, class A1> inline typename AAAAAAAResultCallback_2_1<true, R, T1, P1, P2, A1>::base* NewCallback(T1* obj, R(T2::* member)(P1, P2, A1), const P1& p1, const P2& p2) {} namespace util { class Status {}; } class xxxxxxxxxxxxxxxxx { void Bar(wstring* s, util::Status* status, Callback2<util::Status, wstring>* done); void Foo(); }; void xxxxxxxxxxxxxxxxx::Foo() { wstring* s = __null; util::Status* status = __null; Closure* cb = NewCallback(this, &xxxxxxxxxxxxxxxxx::Bar, s, status); // expected-error{{cannot initialize}} }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-no-category.c
#error foo #error bar // RUN: rm -f %t // RUN: not %clang -ferror-limit=1 -fsyntax-only %s --serialize-diagnostics %t > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s // This test case tests that we can handle both fatal errors and errors without categories. // CHECK: {{.*[/\\]}}serialized-diags-no-category.c:1:2: error: foo [] // CHECK: Number of diagnostics: 2
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/integer-literal-printing.cpp
// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11 // PR11179 template <short T> class Type1 {}; template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}} template <unsigned short T> class Type2 {}; template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: expects an l-value for 1st argument}} enum class boolTy : bool { b = 0, }; template <boolTy T> struct Type3Helper; template <> struct Type3Helper<boolTy::b> { typedef boolTy Ty; }; template <boolTy T, typename Type3Helper<T>::Ty U> struct Type3 {}; // PR14386 enum class charTy : char { c = 0, }; template <charTy T> struct Type4Helper; template <> struct Type4Helper<charTy::c> { typedef charTy Ty; }; template <charTy T, typename Type4Helper<T>::Ty U> struct Type4 {}; enum class scharTy : signed char { c = 0, }; template <scharTy T> struct Type5Helper; template <> struct Type5Helper<scharTy::c> { typedef scharTy Ty; }; template <scharTy T, typename Type5Helper<T>::Ty U> struct Type5 {}; enum class ucharTy : unsigned char { c = 0, }; template <ucharTy T> struct Type6Helper; template <> struct Type6Helper<ucharTy::c> { typedef ucharTy Ty; }; template <ucharTy T, typename Type6Helper<T>::Ty U> struct Type6 {}; enum class wcharTy : wchar_t { c = 0, }; template <wcharTy T> struct Type7Helper; template <> struct Type7Helper<wcharTy::c> { typedef wcharTy Ty; }; template <wcharTy T, typename Type7Helper<T>::Ty U> struct Type7 {}; enum class char16Ty : char16_t { c = 0, }; template <char16Ty T> struct Type8Helper; template <> struct Type8Helper<char16Ty::c> { typedef char16Ty Ty; }; template <char16Ty T, typename Type8Helper<T>::Ty U> struct Type8 {}; enum class char32Ty : char16_t { c = 0, }; template <char32Ty T> struct Type9Helper; template <> struct Type9Helper<char32Ty::c> { typedef char32Ty Ty; }; template <char32Ty T, typename Type9Helper<T>::Ty U> struct Type9 {}; void Function() { Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}} Function2(Type2<42>()); // expected-error{{no matching function for call to 'Function2'}} struct Type3<boolTy::b, "3"> t3; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type3Helper<(boolTy)false>::Ty' (aka 'boolTy')}} struct Type4<charTy::c, "4"> t4; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type4Helper<(charTy)'\x00'>::Ty' (aka 'charTy')}} struct Type5<scharTy::c, "5"> t5; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type5Helper<(scharTy)'\x00'>::Ty' (aka 'scharTy')}} struct Type6<ucharTy::c, "6"> t6; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type6Helper<(ucharTy)'\x00'>::Ty' (aka 'ucharTy')}} struct Type7<wcharTy::c, "7"> t7; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type7Helper<(wcharTy)L'\x00'>::Ty' (aka 'wcharTy')}} struct Type8<char16Ty::c, "8"> t8; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type8Helper<(char16Ty)u'\x00'>::Ty' (aka 'char16Ty')}} struct Type9<char32Ty::c, "9"> t9; // expected-error{{value of type 'const char [2]' is not implicitly convertible to 'typename Type9Helper<(char32Ty)u'\x00'>::Ty' (aka 'char32Ty')}} }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/emit-html-insert.c
// RUN: %clang_cc1 %s -emit-html -o - | grep ">&lt; 10; }" int a(int x) { return x < 10; }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/caret-diags-scratch-buffer.c
// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | not grep keyXXXX // This should not show keyXXXX in the caret diag output. This once // happened because the two tokens ended up in the scratch buffer and // the caret diag from the scratch buffer included the previous token. #define M(name) \ if (name ## XXXX != name ## _sb); void foo() { int keyXXXX; M(key); }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warning-flags.c
RUN: diagtool list-warnings > %t 2>&1 RUN: FileCheck --input-file=%t %s This test serves two purposes: (1) It documents all existing warnings that currently have no associated -W flag, and ensures that the list never grows. If take an existing warning and add a flag, this test will fail. To fix this test, simply remove that warning from the list below. (2) It prevents us adding new warnings to Clang that have no -W flag. All new warnings should have -W flags. If you add a new warning without a flag, this test will fail. To fix this test, simply add a warning group to that warning. The list of warnings below should NEVER grow. It should gradually shrink to 0. CHECK: Warnings without flags (93): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list CHECK-NEXT: ext_explicit_specialization_storage_class CHECK-NEXT: ext_implicit_lib_function_decl CHECK-NEXT: ext_initializer_string_for_char_array_too_long CHECK-NEXT: ext_missing_declspec CHECK-NEXT: ext_missing_whitespace_after_macro_name CHECK-NEXT: ext_new_paren_array_nonconst CHECK-NEXT: ext_plain_complex CHECK-NEXT: ext_template_arg_extra_parens CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer CHECK-NEXT: ext_using_undefined_std CHECK-NEXT: pp_include_next_absolute_path CHECK-NEXT: pp_include_next_in_primary CHECK-NEXT: pp_invalid_string_literal CHECK-NEXT: pp_out_of_date_dependency CHECK-NEXT: pp_poisoning_existing_macro CHECK-NEXT: pp_pragma_once_in_main_file CHECK-NEXT: pp_pragma_sysheader_in_main_file CHECK-NEXT: w_asm_qualifier_ignored CHECK-NEXT: warn_accessor_property_type_mismatch CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size CHECK-NEXT: warn_arcmt_nsalloc_realloc CHECK-NEXT: warn_asm_label_on_auto_decl CHECK-NEXT: warn_bitfield_width_exceeds_type_size CHECK-NEXT: warn_c_kext CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor CHECK-NEXT: warn_call_wrong_number_of_arguments CHECK-NEXT: warn_case_empty_range CHECK-NEXT: warn_char_constant_too_large CHECK-NEXT: warn_collection_expr_type CHECK-NEXT: warn_conflicting_variadic CHECK-NEXT: warn_conv_to_base_not_used CHECK-NEXT: warn_conv_to_self_not_used CHECK-NEXT: warn_conv_to_void_not_used CHECK-NEXT: warn_delete_array_type CHECK-NEXT: warn_double_const_requires_fp64 CHECK-NEXT: warn_drv_assuming_mfloat_abi_is CHECK-NEXT: warn_drv_clang_unsupported CHECK-NEXT: warn_drv_objc_gc_unsupported CHECK-NEXT: warn_drv_pch_not_first_include CHECK-NEXT: warn_dup_category_def CHECK-NEXT: warn_duplicate_protocol_def CHECK-NEXT: warn_enum_value_overflow CHECK-NEXT: warn_expected_qualified_after_typename CHECK-NEXT: warn_extraneous_char_constant CHECK-NEXT: warn_fe_cc_log_diagnostics_failure CHECK-NEXT: warn_fe_cc_print_header_failure CHECK-NEXT: warn_fe_macro_contains_embedded_newline CHECK-NEXT: warn_file_asm_volatile CHECK-NEXT: warn_ignoring_ftabstop_value CHECK-NEXT: warn_implements_nscopying CHECK-NEXT: warn_incompatible_qualified_id CHECK-NEXT: warn_inline_namespace_reopened_noninline CHECK-NEXT: warn_invalid_asm_cast_lvalue CHECK-NEXT: warn_maynot_respond CHECK-NEXT: warn_method_param_redefinition CHECK-NEXT: warn_missing_case_for_condition CHECK-NEXT: warn_missing_dependent_template_keyword CHECK-NEXT: warn_missing_exception_specification CHECK-NEXT: warn_missing_whitespace_after_macro_name CHECK-NEXT: warn_mt_message CHECK-NEXT: warn_no_constructor_for_refconst CHECK-NEXT: warn_not_compound_assign CHECK-NEXT: warn_objc_property_copy_missing_on_block CHECK-NEXT: warn_objc_protocol_qualifier_missing_id CHECK-NEXT: warn_on_superclass_use CHECK-NEXT: warn_partial_specs_not_deducible CHECK-NEXT: warn_pp_convert_lhs_to_positive CHECK-NEXT: warn_pp_convert_rhs_to_positive CHECK-NEXT: warn_pp_expr_overflow CHECK-NEXT: warn_pp_line_decimal CHECK-NEXT: warn_pragma_pack_pop_identifer_and_alignment CHECK-NEXT: warn_pragma_pack_show CHECK-NEXT: warn_property_getter_owning_mismatch CHECK-NEXT: warn_register_objc_catch_parm CHECK-NEXT: warn_related_result_type_compatibility_class CHECK-NEXT: warn_related_result_type_compatibility_protocol CHECK-NEXT: warn_template_export_unsupported CHECK-NEXT: warn_template_spec_extra_headers CHECK-NEXT: warn_tentative_incomplete_array CHECK-NEXT: warn_typecheck_function_qualifiers CHECK-NEXT: warn_undef_interface CHECK-NEXT: warn_undef_interface_suggest CHECK-NEXT: warn_undef_protocolref CHECK-NEXT: warn_use_out_of_scope_declaration CHECK-NEXT: warn_weak_identifier_undeclared CHECK-NEXT: warn_weak_import The list of warnings in -Wpedantic should NEVER grow. CHECK: Number in -Wpedantic (not covered by other -W flags): 28
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/caret-diags-macros.c
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -strict-whitespace #define M1(x) x #define M2 1; void foo() { M1( M2); // CHECK: {{.*}}:7:{{[0-9]+}}: warning: expression result unused // CHECK: {{.*}}:4:{{[0-9]+}}: note: expanded from macro 'M2' // CHECK: {{.*}}:3:{{[0-9]+}}: note: expanded from macro 'M1' } #define A(x) x #define B(x) A(x) #define C(x) B(x) void bar() { C(1); // CHECK: {{.*}}:17:5: warning: expression result unused // CHECK: {{.*}}:15:16: note: expanded from macro 'C' // CHECK: {{.*}}:14:16: note: expanded from macro 'B' // CHECK: {{.*}}:13:14: note: expanded from macro 'A' } // rdar://7597492 #define sprintf(str, A, B) \ __builtin___sprintf_chk (str, 0, 42, A, B) void baz(char *Msg) { sprintf(Msg, " sizeof FoooLib : =%3u\n", 12LL); } // PR9279: comprehensive tests for multi-level macro back traces #define macro_args1(x) x #define macro_args2(x) macro_args1(x) #define macro_args3(x) macro_args2(x) #define macro_many_args1(x, y, z) y #define macro_many_args2(x, y, z) macro_many_args1(x, y, z) #define macro_many_args3(x, y, z) macro_many_args2(x, y, z) void test() { macro_args3(11); // CHECK: {{.*}}:43:15: warning: expression result unused // Also check that the 'caret' printing agrees with the location here where // its easy to FileCheck. // CHECK-NEXT: macro_args3(11); // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:36:36: note: expanded from macro 'macro_args3' // CHECK: {{.*}}:35:36: note: expanded from macro 'macro_args2' // CHECK: {{.*}}:34:24: note: expanded from macro 'macro_args1' macro_many_args3( 1, 2, 3); // CHECK: {{.*}}:55:5: warning: expression result unused // CHECK: {{.*}}:40:55: note: expanded from macro 'macro_many_args3' // CHECK: {{.*}}:39:55: note: expanded from macro 'macro_many_args2' // CHECK: {{.*}}:38:35: note: expanded from macro 'macro_many_args1' macro_many_args3( 1, M2, 3); // CHECK: {{.*}}:64:5: warning: expression result unused // CHECK: {{.*}}:4:12: note: expanded from macro 'M2' // CHECK: {{.*}}:40:55: note: expanded from macro 'macro_many_args3' // CHECK: {{.*}}:39:55: note: expanded from macro 'macro_many_args2' // CHECK: {{.*}}:38:35: note: expanded from macro 'macro_many_args1' macro_many_args3( 1, macro_args2(22), 3); // CHECK: {{.*}}:74:17: warning: expression result unused // This caret location needs to be printed *inside* a different macro's // arguments. // CHECK-NEXT: macro_args2(22), // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:35:36: note: expanded from macro 'macro_args2' // CHECK: {{.*}}:34:24: note: expanded from macro 'macro_args1' // CHECK: {{.*}}:40:55: note: expanded from macro 'macro_many_args3' // CHECK: {{.*}}:39:55: note: expanded from macro 'macro_many_args2' // CHECK: {{.*}}:38:35: note: expanded from macro 'macro_many_args1' } #define variadic_args1(x, y, ...) y #define variadic_args2(x, ...) variadic_args1(x, __VA_ARGS__) #define variadic_args3(x, y, ...) variadic_args2(x, y, __VA_ARGS__) void test2() { variadic_args3(1, 22, 3, 4); // CHECK: {{.*}}:93:21: warning: expression result unused // CHECK-NEXT: variadic_args3(1, 22, 3, 4); // CHECK-NEXT: {{^ \^~}} // CHECK: {{.*}}:90:53: note: expanded from macro 'variadic_args3' // CHECK: {{.*}}:89:50: note: expanded from macro 'variadic_args2' // CHECK: {{.*}}:88:35: note: expanded from macro 'variadic_args1' } #define variadic_pasting_args1(x, y, z) y #define variadic_pasting_args2(x, ...) variadic_pasting_args1(x ## __VA_ARGS__) #define variadic_pasting_args2a(x, y, ...) variadic_pasting_args1(x, y ## __VA_ARGS__) #define variadic_pasting_args3(x, y, ...) variadic_pasting_args2(x, y, __VA_ARGS__) #define variadic_pasting_args3a(x, y, ...) variadic_pasting_args2a(x, y, __VA_ARGS__) void test3() { variadic_pasting_args3(1, 2, 3, 4); // CHECK: {{.*}}:109:32: warning: expression result unused // CHECK: {{.*}}:105:72: note: expanded from macro 'variadic_pasting_args3' // CHECK: {{.*}}:103:68: note: expanded from macro 'variadic_pasting_args2' // CHECK: {{.*}}:102:41: note: expanded from macro 'variadic_pasting_args1' variadic_pasting_args3a(1, 2, 3, 4); // CHECK: {{.*}}:115:3: warning: expression result unused // CHECK-NEXT: variadic_pasting_args3a(1, 2, 3, 4); // CHECK-NEXT: {{ \^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}} // CHECK: {{.*}}:106:44: note: expanded from macro 'variadic_pasting_args3a' // CHECK-NEXT: #define variadic_pasting_args3a(x, y, ...) variadic_pasting_args2a(x, y, __VA_ARGS__) // CHECK-NEXT: {{ \^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}} // CHECK: {{.*}}:104:70: note: expanded from macro 'variadic_pasting_args2a' // CHECK-NEXT: #define variadic_pasting_args2a(x, y, ...) variadic_pasting_args1(x, y ## __VA_ARGS__) // CHECK-NEXT: {{ \^~~~~~~~~~~~~~~~}} // CHECK: {{.*}}:102:41: note: expanded from macro 'variadic_pasting_args1' // CHECK-NEXT: #define variadic_pasting_args1(x, y, z) y // CHECK-NEXT: {{ \^}} } #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 int test4 = BAD_CONDITIONAL_OPERATOR+BAD_CONDITIONAL_OPERATOR; // CHECK: {{.*}}:130:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' // CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 // CHECK-NEXT: {{^ \^}} // CHECK: {{.*}}:130:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' // CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 // CHECK-NEXT: {{^ \^}} // CHECK: {{.*}}:130:39: note: expanded from macro 'BAD_CONDITIONAL_OPERATOR' // CHECK-NEXT: #define BAD_CONDITIONAL_OPERATOR (2<3)?2:3 // CHECK-NEXT: {{^ ~~~~~\^~~~}} #define QMARK ? #define TWOL (2< #define X 1+TWOL 3) QMARK 4:5 int x = X; // CHECK: {{.*}}:145:9: note: place parentheses around the '+' expression to silence this warning // CHECK-NEXT: int x = X; // CHECK-NEXT: {{^ \^}} // CHECK-NEXT: {{.*}}:144:21: note: expanded from macro 'X' // CHECK-NEXT: #define X 1+TWOL 3) QMARK 4:5 // CHECK-NEXT: {{^ ~~~~~~~~~ \^}} // CHECK-NEXT: {{.*}}:142:15: note: expanded from macro 'QMARK' // CHECK-NEXT: #define QMARK ? // CHECK-NEXT: {{^ \^}} // CHECK-NEXT: {{.*}}:145:9: note: place parentheses around the '?:' expression to evaluate it first // CHECK-NEXT: int x = X; // CHECK-NEXT: {{^ \^}} // CHECK-NEXT: {{.*}}:144:21: note: expanded from macro 'X' // CHECK-NEXT: #define X 1+TWOL 3) QMARK 4:5 // CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~}} #define ONEPLUS 1+ #define Y ONEPLUS (2<3) QMARK 4:5 int y = Y; // CHECK: {{.*}}:164:9: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first // CHECK-NEXT: int y = Y; // CHECK-NEXT: {{^ \^}} // CHECK-NEXT: {{.*}}:163:25: note: expanded from macro 'Y' // CHECK-NEXT: #define Y ONEPLUS (2<3) QMARK 4:5 // CHECK-NEXT: {{^ ~~~~~~~~~~~~~ \^}} // CHECK-NEXT: {{.*}}:142:15: note: expanded from macro 'QMARK' // CHECK-NEXT: #define QMARK ? // CHECK-NEXT: {{^ \^}} // PR14399 void iequals(int,int,int); void foo_aa(char* s) { #define /* */ BARC(c, /* */b, a) (a + b ? c : c) iequals(__LINE__, BARC(123, (456 < 345), 789), 8); } // CHECK: {{.*}}:180:21: warning: operator '?:' has lower precedence than '+' // CHECK-NEXT: iequals(__LINE__, BARC(123, (456 < 345), 789), 8); // CHECK-NEXT: {{^ \^~~~~~~~~~~~~~~~~~~~~~~~~~~}} // CHECK-NEXT: {{.*}}:179:41: note: expanded from macro 'BARC' // CHECK-NEXT: #define /* */ BARC(c, /* */b, a) (a + b ? c : c) // CHECK-NEXT: {{^ ~~~~~ \^}} #define APPEND2(NUM, SUFF) -1 != NUM ## SUFF #define APPEND(NUM, SUFF) APPEND2(NUM, SUFF) #define UTARG_MAX_U APPEND (MAX_UINT, UL) #define MAX_UINT 18446744073709551615 #if UTARG_MAX_U #endif // CHECK: {{.*}}:193:5: warning: left side of operator converted from negative value to unsigned: -1 to 18446744073709551615 // CHECK-NEXT: #if UTARG_MAX_U // CHECK-NEXT: {{^ \^~~~~~~~~~~}} // CHECK-NEXT: {{.*}}:191:21: note: expanded from macro 'UTARG_MAX_U' // CHECK-NEXT: #define UTARG_MAX_U APPEND (MAX_UINT, UL) // CHECK-NEXT: {{^ \^~~~~~~~~~~~~~~~~~~~~}} // CHECK-NEXT: {{.*}}:190:27: note: expanded from macro 'APPEND' // CHECK-NEXT: #define APPEND(NUM, SUFF) APPEND2(NUM, SUFF) // CHECK-NEXT: {{^ \^~~~~~~~~~~~~~~~~~}} // CHECK-NEXT: {{.*}}:189:31: note: expanded from macro 'APPEND2' // CHECK-NEXT: #define APPEND2(NUM, SUFF) -1 != NUM ## SUFF // CHECK-NEXT: {{^ ~~ \^ ~~~~~~~~~~~}} unsigned long strlen_test(const char *s); #define __darwin_obsz(object) __builtin_object_size (object, 1) #define sprintf2(str, ...) \ __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) #define Cstrlen(a) strlen_test(a) #define Csprintf sprintf2 void f(char* pMsgBuf, char* pKeepBuf) { Csprintf(pMsgBuf,"\nEnter minimum anagram length (2-%1d): ", Cstrlen(pKeepBuf)); } // CHECK: {{.*}}:216:62: warning: format specifies type 'int' but the argument has type 'unsigned long' // CHECK-NEXT: Csprintf(pMsgBuf,"\nEnter minimum anagram length (2-%1d): ", Cstrlen(pKeepBuf)); // CHECK-NEXT: {{^ ~~~ \^}} // CHECK-NEXT: {{^ %1lu}} // CHECK-NEXT: {{.*}}:213:21: note: expanded from macro 'Cstrlen' // CHECK-NEXT: #define Cstrlen(a) strlen_test(a) // CHECK-NEXT: {{^ \^}} // CHECK-NEXT: {{.*}}:212:56: note: expanded from macro 'sprintf2' // CHECK-NEXT: __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) // CHECK-NEXT: {{^ \^}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-templates.cpp
// RUN: %clang_cc1 -ast-print %s > %t // RUN: FileCheck < %t %s -check-prefix=CHECK1 // RUN: FileCheck < %t %s -check-prefix=CHECK2 // RUN: %clang_cc1 -ast-dump %s | FileCheck --check-prefix=DUMP %s template <int X, typename Y, int Z = 5> struct foo { int constant; foo() {} Y getSum() { return Y(X + Z); } }; template <int A, typename B> B bar() { return B(A); } void baz() { int x = bar<5, int>(); int y = foo<5, int>().getSum(); double z = foo<2, double, 3>().getSum(); } // Template instantiation - foo // Since the order of instantiation may vary during runs, run FileCheck twice // to make sure each instantiation is in the correct spot. // CHECK1: template <int X = 5, typename Y = int, int Z = 5> struct foo { // CHECK2: template <int X = 2, typename Y = double, int Z = 3> struct foo { // Template definition - foo // CHECK1: template <int X, typename Y, int Z = 5> struct foo { // CHECK2: template <int X, typename Y, int Z = 5> struct foo { // Template instantiation - bar // CHECK1: template <int A = 5, typename B = int> int bar() // CHECK2: template <int A = 5, typename B = int> int bar() // Template definition - bar // CHECK1: template <int A, typename B> B bar() // CHECK2: template <int A, typename B> B bar() // CHECK1-LABEL: template <typename ...T> struct A { // CHECK1-NEXT: template <T ...x[3]> struct B { template <typename ...T> struct A { template <T ...x[3]> struct B {}; }; // CHECK1-LABEL: template <typename ...T> void f(T ...[3]) { // CHECK1-NEXT: A<T [3]...> a; template <typename ...T> void f(T ...[3]) { A<T [3]...> a; } namespace test2 { void func(int); void func(float); template<typename T> void tmpl() { func(T()); } // DUMP: UnresolvedLookupExpr {{.*}} <col:3> '<overloaded function type>' lvalue (ADL) = 'func' }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/verify.c
// RUN: %clang_cc1 -fsyntax-only -verify %s struct s; // expected-note 7 {{forward declaration of 'struct s'}} // standard string matching struct s s1; // expected-error {{tentative definition has type 'struct s' that is never completed}} struct s s2; // expected-error {{tentative definition has type}} // regex matching struct s r1; // expected-error {{tentative definition has type 'struct s' that is never completed}} struct s r2; // expected-error-re {{tentative definition has type '{{.*[[:space:]]*.*}}' that is never completed}} struct s r3; // expected-error-re {{tentative definition has type '{{(.*)[[:space:]]*(.*)}}' that is never completed}} struct s r4; // expected-error-re {{{{^}}tentative}} struct s r5; // expected-error-re {{completed{{$}}}}
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/emit-html.c
// RUN: %clang_cc1 %s -emit-html -o - // rdar://6562329 #line 42 "foo.c" // PR3635 #define F(fmt, ...) fmt, ## __VA_ARGS__ int main(int argc, char **argv) { return F(argc, 1); } // PR3798 #define FOR_ALL_FILES(f,i) i #if 0 FOR_ALL_FILES(f) { } #endif // <rdar://problem/11625964> // -emit-html filters out # directives, but not _Pragma (or MS __pragma) // Diagnostic push/pop is stateful, so re-lexing a file can cause problems // if these pragmas are interpreted normally. _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"") _Pragma("clang diagnostic pop")
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-aka-types.cpp
// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11 struct X {}; typedef X foo_t; foo_t *ptr; char c1 = ptr; // expected-error{{'foo_t *' (aka 'X *')}} const foo_t &ref = foo_t(); char c2 = ref; // expected-error{{'const foo_t' (aka 'const X')}} // deduced auto should not produce an aka. auto aut = X(); char c3 = aut; // expected-error{{from 'X' to 'char'}} // There are two classes named Foo::foo here. Make sure the message gives // a way to them apart. namespace Foo { class foo {}; } namespace bar { namespace Foo { class foo; } void f(Foo::foo* x); // expected-note{{passing argument to parameter 'x' here}} } void test(Foo::foo* x) { bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *'}} } namespace ns { struct str { static void method(struct data *) {} }; } struct data { int i; }; typedef void (*callback)(struct data *); void helper(callback cb) {} // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument}} void test() { helper(&ns::str::method); // expected-error{{no matching function for call to 'helper'}} }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/backend-stack-frame-diagnostics.cpp
// REQUIRES: x86-registered-target // RUN: %clang -target i386-apple-darwin -std=c++11 -fblocks -Wframe-larger-than=70 -Xclang -verify -o /dev/null -c %s // RUN: %clang -target i386-apple-darwin -std=c++11 -fblocks -Wframe-larger-than=70 -Xclang -verify -o /dev/null -c %s -DIS_SYSHEADER // Test that: // * The driver passes the option through to the backend. // * The frontend diagnostic handler 'demangles' and resolves the correct function definition. // Test that link invocations don't emit an "argument unused during compilation" diagnostic. // RUN: touch %t.o // RUN: %clang -Werror -Wframe-larger-than=0 %t.o -### 2>&1 | not grep ' error: ' // TODO: Support rich backend diagnostics for Objective-C methods. // Backend diagnostics aren't suppressed in system headers because such results // are significant and actionable. #ifdef IS_HEADER #ifdef IS_SYSHEADER #pragma clang system_header #endif extern void doIt(char *); void frameSizeWarning(int, int) {} void frameSizeWarning(); void frameSizeWarning() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeWarning'}} char buffer[80]; doIt(buffer); } void frameSizeWarning(); void frameSizeWarning(int) {} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wframe-larger-than=" void frameSizeWarningIgnored() { char buffer[80]; doIt(buffer); } #pragma GCC diagnostic pop #pragma GCC diagnostic push #ifndef IS_SYSHEADER // expected-warning@+2 {{unknown warning group '-Wframe-larger-than'}} #endif #pragma GCC diagnostic ignored "-Wframe-larger-than" #pragma GCC diagnostic pop void frameSizeLocalClassWarning() { struct S { S() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeLocalClassWarning()::S::S'}} char buffer[80]; doIt(buffer); } }; S(); } void frameSizeLambdaWarning() { auto fn = []() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in lambda expression}} char buffer[80]; doIt(buffer); }; fn(); } void frameSizeBlocksWarning() { auto fn = ^() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in block literal}} char buffer[80]; doIt(buffer); }; fn(); } #else #define IS_HEADER #include __FILE__ #endif
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-print-pragmas-xfail.cpp
// RUN: %clang_cc1 %s -ast-print -o - | FileCheck %s // FIXME: Test fails because attribute order is reversed by ParsedAttributes. // XFAIL: * void run1(int *List, int Length) { int i = 0; // CEHCK: #pragma loop vectorize(4) // CHECK-NEXT: #pragma loop interleave(8) // CHECK-NEXT: #pragma loop vectorize(enable) // CHECK-NEXT: #pragma loop interleave(enable) #pragma loop vectorize(4) #pragma loop interleave(8) #pragma loop vectorize(enable) #pragma loop interleave(enable) // CHECK-NEXT: while (i < Length) while (i < Length) { List[i] = i; i++; } }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-template-diffing-color.cpp
// RUN: not %clang_cc1 -fsyntax-only -fcolor-diagnostics %s 2>&1 | FileCheck %s // RUN: not %clang_cc1 -fsyntax-only -fcolor-diagnostics -fdiagnostics-show-template-tree %s 2>&1 | FileCheck %s -check-prefix=TREE // REQUIRES: ansi-escape-sequences template<typename> struct foo {}; void func(foo<int>); int main() { func(foo<double>()); } // CHECK: {{.*}}candidate function not viable: no known conversion from 'foo<[[CYAN:.\[0;1;36m]]double[[RESET:.\[0m]]>' to 'foo<[[CYAN]]int[[RESET]]>' for 1st argument[[RESET]] // TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: foo< // TREE: {{\[}}[[CYAN:.\[0;1;36m]]double[[RESET:.\[0m]] != [[CYAN]]int[[RESET]]]>[[RESET]] foo<int> A; foo<double> &B = A; // CHECK: {{.*}}non-const lvalue reference to type 'foo<[[CYAN]]double[[RESET]][[BOLD:.\[1m]]>' cannot bind to a value of unrelated type 'foo<[[CYAN]]int[[RESET]][[BOLD]]>'[[RESET]] // TREE: non-const lvalue reference cannot bind to a value of unrelated type // TREE: foo< // TREE: {{\[}}[[CYAN]]double[[RESET]][[BOLD:.\[1m]] != [[CYAN]]int[[RESET]][[BOLD]]]>[[RESET]] template<typename> class vector {}; void set15(vector<const vector<int> >) {} void test15() { set15(vector<const vector<const int> >()); } // CHECK: {{.*}}candidate function not viable: no known conversion from 'vector<const vector<[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}int>>' to 'vector<const vector<int>>' for 1st argument // TREE: {{.*}}candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: vector< // TREE: const vector< // TREE: {{\[}}[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}!= [[CYAN]](no qualifiers)[[RESET]]] int>> void set16(vector<vector<int> >) {} void test16() { set16(vector<const vector<int> >()); } // CHECK: {{.*}}candidate function not viable: no known conversion from 'vector<[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}vector<[...]>>' to 'vector<vector<[...]>>' for 1st argument // TREE: {{.*}}candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: vector< // TREE: {{\[}}[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}!= [[CYAN]](no qualifiers){{ ?}}[[RESET]]]{{ ?}}vector< // TREE: [...]>> void set17(vector<const vector<int> >) {} void test17() { set17(vector<vector<int> >()); } // CHECK: candidate function not viable: no known conversion from 'vector<vector<[...]>>' to 'vector<[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}vector<[...]>>' for 1st argument // TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: vector< // TREE: {{\[}}[[CYAN]](no qualifiers){{ ?}}[[RESET]]{{ ?}}!= [[CYAN]]const[[RESET]]] vector< // TREE: [...]>> void set18(vector<volatile vector<int> >) {} void test18() { set18(vector<const vector<int> >()); } // CHECK: candidate function not viable: no known conversion from 'vector<[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}vector<[...]>>' to 'vector<[[CYAN]]volatile{{ ?}}[[RESET]]{{ ?}}vector<[...]>>' for 1st argument // TREE: no matching function for call to 'set18' // TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: vector< // TREE: {{\[}}[[CYAN]]const{{ ?}}[[RESET]]{{ ?}}!= [[CYAN]]volatile[[RESET]]] vector< // TREE: [...]>> void set19(vector<const volatile vector<int> >) {} void test19() { set19(vector<const vector<int> >()); } // CHECK: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<const [[CYAN]]volatile{{ ?}}[[RESET]]{{ ?}}vector<[...]>>' for 1st argument // TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // TREE: vector< // TREE: [const != const [[CYAN]]volatile[[RESET]]] vector< // TREE: [...]>> namespace default_args { template <int x, int y = 1+1, int z = 2> class A {}; void foo(A<0> &M) { // CHECK: no viable conversion from 'A<[...], (default) [[CYAN]]1 + 1[[RESET]][[BOLD]] aka [[CYAN]]2[[RESET]][[BOLD]], (default) [[CYAN]]2[[RESET]][[BOLD]]>' to 'A<[...], [[CYAN]]0[[RESET]][[BOLD]], [[CYAN]]0[[RESET]][[BOLD]]>' A<0, 0, 0> N = M; // CHECK: no viable conversion from 'A<[2 * ...], (default) [[CYAN]]2[[RESET]][[BOLD]]>' to 'A<[2 * ...], [[CYAN]]0[[RESET]][[BOLD]]>' A<0, 2, 0> N2 = M; } }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/interpreter.c
// RUN: clang-interpreter %s | FileCheck %s // REQUIRES: native, examples int printf(const char *, ...); int main() { // CHECK: {{Hello world!}} printf("Hello world!\n"); return 0; }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/backend-stack-frame-diagnostics-fallback.cpp
// REQUIRES: x86-registered-target // RUN: %clang_cc1 %s -mllvm -warn-stack-size=0 -emit-codegen-only -triple=i386-apple-darwin 2>&1 | FileCheck %s // TODO: Emit rich diagnostics for thunks and move this into the appropriate test file. // Until then, test that we fall back and display the LLVM backend diagnostic. namespace frameSizeThunkWarning { struct A { virtual void f(); }; struct B : virtual A { virtual void f(); }; // CHECK: warning: stack frame size of {{[0-9]+}} bytes in function 'frameSizeThunkWarning::B::f' // CHECK: warning: stack size limit exceeded ({{[0-9]+}}) in {{[^ ]+}} void B::f() { } }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-color.cpp
// RUN: not %clang_cc1 -triple x86_64-pc-linux -std=c++11 -ast-dump -fcolor-diagnostics %s | FileCheck --strict-whitespace %s // REQUIRES: ansi-escape-sequences /// <a>Hello</a> /// <br/> int Test __attribute__((unused)); /// Comment void TestAttributedStmt() { switch (1) { case 1: [[clang::fallthrough]]; case 2: ; } } class __attribute__((lockable)) Mutex { /// A variable int var1; /// Another variable /// /// Like the other variable, but different int var2; } mu1, mu2; int TestExpr __attribute__((guarded_by(mu1))); struct Invalid { __attribute__((noinline)) Invalid(error); } Invalid; //CHECK: {{^}}[[GREEN:.\[0;1;32m]]TranslationUnitDecl[[RESET:.\[0m]][[Yellow:.\[0;33m]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]<invalid sloc>[[RESET]]> [[Yellow]]<invalid sloc>[[RESET]]{{$}} //CHECK: {{^}}[[Blue:.\[0;34m]]|-[[RESET]][[GREEN]]TypedefDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]<invalid sloc>[[RESET]]> [[Yellow]]<invalid sloc>[[RESET]] implicit[[CYAN:.\[0;1;36m]] __int128_t[[RESET]] [[Green:.\[0;32m]]'__int128'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]TypedefDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]<invalid sloc>[[RESET]]> [[Yellow]]<invalid sloc>[[RESET]] implicit[[CYAN]] __uint128_t[[RESET]] [[Green]]'unsigned __int128'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]TypedefDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]<invalid sloc>[[RESET]]> [[Yellow]]<invalid sloc>[[RESET]] implicit[[CYAN]] __builtin_va_list[[RESET]] [[Green]]'__va_list_tag [1]'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]{{.*}}ast-dump-color.cpp:6:1[[RESET]], [[Yellow]]col:5[[RESET]]> [[Yellow]]col:5[[RESET]][[CYAN]] Test[[RESET]] [[Green]]'int'[[RESET]] //CHECK: {{^}}[[Blue]]| |-[[RESET]][[BLUE:.\[0;1;34m]]UnusedAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:25[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:4:4[[RESET]], [[Yellow]]line:5:8[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:4:4[[RESET]], [[Yellow]]line:5:8[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:4:4[[RESET]]> Text=" "{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[Blue]]HTMLStartTagComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:5[[RESET]], [[Yellow]]col:7[[RESET]]> Name="a"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]], [[Yellow]]col:12[[RESET]]> Text="Hello"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[Blue]]HTMLEndTagComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:13[[RESET]], [[Yellow]]col:16[[RESET]]> Name="a"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:5:4[[RESET]]> Text=" "{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]HTMLStartTagComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:5[[RESET]], [[Yellow]]col:8[[RESET]]> Name="br" SelfClosing{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]FunctionDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:9:1[[RESET]], [[Yellow]]line:16:1[[RESET]]> [[Yellow]]line:9:6[[RESET]][[CYAN]] TestAttributedStmt[[RESET]] [[Green]]'void (void)'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[MAGENTA:.\[0;1;35m]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:27[[RESET]], [[Yellow]]line:16:1[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]SwitchStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:10:3[[RESET]], [[Yellow]]line:15:3[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[Blue:.\[0;34m]]<<<NULL>>>[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:10:11[[RESET]]> [[Green]]'int'[[RESET]][[Cyan:.\[0;36m]][[RESET]][[Cyan]][[RESET]][[CYAN]] 1[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:14[[RESET]], [[Yellow]]line:15:3[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]CaseStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:11:3[[RESET]], [[Yellow]]line:12:27[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:11:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 1[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[Blue]]<<<NULL>>>[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[MAGENTA]]AttributedStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:12:5[[RESET]], [[Yellow]]col:27[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | | |-[[RESET]][[BLUE]]FallThroughAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:7[[RESET]], [[Yellow]]col:14[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[MAGENTA]]NullStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:27[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CaseStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:13:3[[RESET]], [[Yellow]]line:14:5[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[MAGENTA]]IntegerLiteral[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:13:8[[RESET]]> [[Green]]'int'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]][[CYAN]] 2[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[Blue]]<<<NULL>>>[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]NullStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:14:5[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:8:4[[RESET]], [[Yellow]]col:11[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:4[[RESET]], [[Yellow]]col:11[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:4[[RESET]], [[Yellow]]col:11[[RESET]]> Text=" Comment"{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:1[[RESET]], [[Yellow]]line:25:1[[RESET]]> [[Yellow]]line:18:33[[RESET]] class[[CYAN]] Mutex[[RESET]] definition{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[BLUE]]CapabilityAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:22[[RESET]]> capability "mutex"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]col:33[[RESET]]> [[Yellow]]col:33[[RESET]] implicit class[[CYAN]] Mutex[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]FieldDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:20:3[[RESET]], [[Yellow]]col:7[[RESET]]> [[Yellow]]col:7[[RESET]][[CYAN]] var1[[RESET]] [[Green]]'int'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:19:6[[RESET]], [[Yellow]]col:16[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:16[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:16[[RESET]]> Text=" A variable"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]FieldDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:24:3[[RESET]], [[Yellow]]col:7[[RESET]]> [[Yellow]]col:7[[RESET]][[CYAN]] var2[[RESET]] [[Green]]'int'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]FullComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:21:6[[RESET]], [[Yellow]]line:23:44[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[Blue]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:21:6[[RESET]], [[Yellow]]col:22[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | | `-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:22[[RESET]]> Text=" Another variable"{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]ParagraphComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:23:6[[RESET]], [[Yellow]]col:44[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[Blue]]TextComment[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:6[[RESET]], [[Yellow]]col:44[[RESET]]> Text=" Like the other variable, but different"{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:33[[RESET]]> [[Yellow]]col:33[[RESET]] implicit used[[CYAN]] Mutex[[RESET]] [[Green]]'void (void) noexcept'[[RESET]] inline{{.*$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Yellow]]col:33[[RESET]] implicit constexpr[[CYAN]] Mutex[[RESET]] [[Green]]'void (const class Mutex &)'[[RESET]] inline{{ .*$}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Yellow]]col:33[[RESET]] [[Green]]'const class Mutex &'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Yellow]]col:33[[RESET]] implicit constexpr[[CYAN]] Mutex[[RESET]] [[Green]]'void (class Mutex &&)'[[RESET]] inline{{ .*$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:33[[RESET]]> [[Yellow]]col:33[[RESET]] [[Green]]'class Mutex &&'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]line:25:3[[RESET]]> [[Yellow]]col:3[[RESET]] referenced[[CYAN]] mu1[[RESET]] [[Green]]'class Mutex':'class Mutex'[[RESET]] //CHECK: {{^}}[[Blue]]| `-[[RESET]][[MAGENTA]]CXXConstructExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:3[[RESET]]> [[Green]]'class Mutex':'class Mutex'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]] [[Green]]'void (void) noexcept'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:18:1[[RESET]], [[Yellow]]line:25:8[[RESET]]> [[Yellow]]col:8[[RESET]][[CYAN]] mu2[[RESET]] [[Green]]'class Mutex':'class Mutex'[[RESET]] //CHECK: {{^}}[[Blue]]| `-[[RESET]][[MAGENTA]]CXXConstructExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Green]]'class Mutex':'class Mutex'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]] [[Green]]'void (void) noexcept'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:26:1[[RESET]], [[Yellow]]col:5[[RESET]]> [[Yellow]]col:5[[RESET]][[CYAN]] TestExpr[[RESET]] [[Green]]'int'[[RESET]] //CHECK: {{^}}[[Blue]]| `-[[RESET]][[BLUE]]GuardedByAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:29[[RESET]], [[Yellow]]col:43[[RESET]]>{{$}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[MAGENTA]]DeclRefExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:40[[RESET]]> [[Green]]'class Mutex':'class Mutex'[[RESET]][[Cyan]] lvalue[[RESET]][[Cyan]][[RESET]] [[GREEN]]Var[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]][[CYAN]] 'mu1'[[RESET]] [[Green]]'class Mutex':'class Mutex'[[RESET]]{{$}} //CHECK: {{^}}[[Blue]]|-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:28:1[[RESET]], [[Yellow]]line:30:1[[RESET]]> [[Yellow]]line:28:8[[RESET]] struct[[CYAN]] Invalid[[RESET]] definition //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXRecordDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]col:8[[RESET]]> [[Yellow]]col:8[[RESET]] implicit referenced struct[[CYAN]] Invalid[[RESET]] //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:29:3[[RESET]], [[Yellow]]col:42[[RESET]]> [[Yellow]]col:29[[RESET]] invalid[[CYAN]] Invalid[[RESET]] [[Green]]'void (int)'[[RESET]] //CHECK: {{^}}[[Blue]]| | |-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:37[[RESET]], [[Yellow]]<invalid sloc>[[RESET]]> [[Yellow]]col:42[[RESET]] invalid [[Green]]'int'[[RESET]] //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[BLUE]]NoInlineAttr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:18[[RESET]]> //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]line:28:8[[RESET]]> [[Yellow]]col:8[[RESET]] implicit used constexpr[[CYAN]] Invalid[[RESET]] [[Green]]'void (void) noexcept'[[RESET]] inline //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[MAGENTA]]CompoundStmt[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> //CHECK: {{^}}[[Blue]]| |-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Yellow]]col:8[[RESET]] implicit constexpr[[CYAN]] Invalid[[RESET]] [[Green]]'void (const struct Invalid &)'[[RESET]] inline noexcept-unevaluated 0x{{[0-9a-fA-F]*}} //CHECK: {{^}}[[Blue]]| | `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Yellow]]col:8[[RESET]] [[Green]]'const struct Invalid &'[[RESET]] //CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]CXXConstructorDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Yellow]]col:8[[RESET]] implicit constexpr[[CYAN]] Invalid[[RESET]] [[Green]]'void (struct Invalid &&)'[[RESET]] inline noexcept-unevaluated 0x{{[0-9a-fA-F]*}} //CHECK: {{^}}[[Blue]]| `-[[RESET]][[GREEN]]ParmVarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:8[[RESET]]> [[Yellow]]col:8[[RESET]] [[Green]]'struct Invalid &&'[[RESET]] //CHECK: {{^}}[[Blue]]`-[[RESET]][[GREEN]]VarDecl[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:1[[RESET]], [[Yellow]]line:30:3[[RESET]]> [[Yellow]]col:3[[RESET]][[CYAN]] Invalid[[RESET]] [[Green]]'struct Invalid':'struct Invalid'[[RESET]] //CHECK: {{^}}[[Blue]] `-[[RESET]][[MAGENTA]]CXXConstructExpr[[RESET]][[Yellow]] 0x{{[0-9a-fA-F]*}}[[RESET]] <[[Yellow]]col:3[[RESET]]> [[Green]]'struct Invalid':'struct Invalid'[[RESET]][[Cyan]][[RESET]][[Cyan]][[RESET]] [[Green]]'void (void) noexcept'[[RESET]]
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-template-diffing-cxx98.cpp
// RUN: not %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s namespace PR14342 { template<typename T, char a> struct X {}; X<int, 1> x = X<long, 257>(); // CHECK: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>' } namespace PR15513 { template <int x, int y = x+1> class A {}; void foo(A<0> &M) { // CHECK: no viable conversion from 'A<[...], (default) x + 1 aka 1>' to 'A<[...], 0>' A<0, 0> N = M; // CHECK: no viable conversion from 'A<0, [...]>' to 'A<1, [...]>' A<1, 1> O = M; } } namespace default_args { template <int x, int y = 1+1, int z = 2> class A {}; void foo(A<0> &M) { // CHECK: no viable conversion from 'A<[...], (default) 1 + 1 aka 2, (default) 2>' to 'A<[...], 0, 0>' A<0, 0, 0> N = M; // CHECK: no viable conversion from 'A<[2 * ...], (default) 2>' to 'A<[2 * ...], 0>' A<0, 2, 0> N2 = M; } } namespace qualifiers { template <class T> void foo(void (func(T*)), T*) {} template <class T> class vector{}; void bar(const vector<int>*) {} void test(volatile vector<int>* V) { foo(bar, V); } // CHECK: candidate template ignored: deduced conflicting types for parameter 'T' ('const vector<[...]>' vs. 'volatile vector<[...]>') }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-single-issue.c
void foo() { int voodoo; voodoo = voodoo + 1; } // RUN: %clang -Wall -fsyntax-only %s --serialize-diagnostics %t // RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s // RUN: rm -f %t // NOTE: it is important that this test case only contain a single issue. This test case checks // if we can handle serialized diagnostics that contain only one diagnostic. // CHECK: {{.*}}serialized-diags-single-issue.c:3:12: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized] [Semantic Issue] // CHECK: Range: {{.*}}serialized-diags-single-issue.c:3:12 {{.*}}serialized-diags-single-issue.c:3:18 // CHECK: +-{{.*}}serialized-diags-single-issue.c:2:13: note: initialize the variable 'voodoo' to silence this warning [] // CHECK: +-Range: {{.*}}serialized-diags-single-issue.c:2:13 {{.*}}serialized-diags-single-issue.c:2:13 // CHECK: +-FIXIT: ({{.*}}serialized-diags-single-issue.c:2:13 - {{.*}}serialized-diags-single-issue.c:2:13): " = 0" // Test that we handle serializing diagnostics for multiple source files // RUN: %clang_cc1 -Wall -fsyntax-only %s %s -serialize-diagnostic-file %t // RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck -check-prefix=CHECK-MULT %s // RUN: rm -f %t // CHECK-MULT: {{.*}}serialized-diags-single-issue.c:3:12: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized] // CHECK-MULT: Range: {{.*}}serialized-diags-single-issue.c:3:12 {{.*}}serialized-diags-single-issue.c:3:18 // CHECK-MULT: +-{{.*}}serialized-diags-single-issue.c:2:13: note: initialize the variable 'voodoo' to silence this warning [] // CHECK-MULT: +-Range: {{.*}}serialized-diags-single-issue.c:2:13 {{.*}}serialized-diags-single-issue.c:2:13 // CHECK-MULT: +-FIXIT: ({{.*}}serialized-diags-single-issue.c:2:13 - {{.*}}serialized-diags-single-issue.c:2:13): " = 0" // CHECK-MULT: {{.*}}serialized-diags-single-issue.c:3:12: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized] // CHECK-MULT: Range: {{.*}}serialized-diags-single-issue.c:3:12 {{.*}}serialized-diags-single-issue.c:3:18 // CHECK-MULT: +-{{.*}}serialized-diags-single-issue.c:2:13: note: initialize the variable 'voodoo' to silence this warning [] // CHECK-MULT: +-Range: {{.*}}serialized-diags-single-issue.c:2:13 {{.*}}serialized-diags-single-issue.c:2:13 // CHECK-MULT: +-FIXIT: ({{.*}}serialized-diags-single-issue.c:2:13 - {{.*}}serialized-diags-single-issue.c:2:13): " = 0" // CHECK-MULT: Number of diagnostics: 2
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/macro-backtrace.c
// Tests for macro expansion backtraces. The RUN and CHECK lines are grouped // below the test code to reduce noise when updating them. #define M1(A, B) ((A) < (B)) #define M2(A, B) M1(A, B) #define M3(A, B) M2(A, B) #define M4(A, B) M3(A, B) #define M5(A, B) M4(A, B) #define M6(A, B) M5(A, B) #define M7(A, B) M6(A, B) #define M8(A, B) M7(A, B) #define M9(A, B) M8(A, B) #define M10(A, B) M9(A, B) #define M11(A, B) M10(A, B) #define M12(A, B) M11(A, B) void f(int *ip, float *fp) { if (M12(ip, fp)) { } // RUN: %clang_cc1 -fsyntax-only -fmacro-backtrace-limit 5 %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-LIMIT // CHECK-LIMIT: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *') // CHECK-LIMIT: if (M12(ip, fp)) { } // CHECK-LIMIT: macro-backtrace.c:15:19: note: expanded from macro 'M12' // CHECK-LIMIT: #define M12(A, B) M11(A, B) // CHECK-LIMIT: macro-backtrace.c:14:19: note: expanded from macro 'M11' // CHECK-LIMIT: #define M11(A, B) M10(A, B) // CHECK-LIMIT: note: (skipping 7 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) // CHECK-LIMIT: macro-backtrace.c:6:18: note: expanded from macro 'M3' // CHECK-LIMIT: #define M3(A, B) M2(A, B) // CHECK-LIMIT: macro-backtrace.c:5:18: note: expanded from macro 'M2' // CHECK-LIMIT: #define M2(A, B) M1(A, B) // CHECK-LIMIT: macro-backtrace.c:4:23: note: expanded from macro 'M1' // CHECK-LIMIT: #define M1(A, B) ((A) < (B)) // RUN: %clang_cc1 -fsyntax-only -fno-caret-diagnostics %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-NO-CARETS // CHECK-NO-CARETS: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *') // CHECK-NO-CARETS-NEXT: macro-backtrace.c:15:19: note: expanded from macro 'M12' // CHECK-NO-CARETS-NEXT: macro-backtrace.c:14:19: note: expanded from macro 'M11' // CHECK-NO-CARETS-NEXT: macro-backtrace.c:13:19: note: expanded from macro 'M10' // CHECK-NO-CARETS-NEXT: note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) // CHECK-NO-CARETS-NEXT: macro-backtrace.c:6:18: note: expanded from macro 'M3' // CHECK-NO-CARETS-NEXT: macro-backtrace.c:5:18: note: expanded from macro 'M2' // CHECK-NO-CARETS-NEXT: macro-backtrace.c:4:23: note: expanded from macro 'M1' // Check that the expansion notes respect the same formatting options as // other diagnostics. // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-format vi %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHECK-NOTE-FORMAT // CHECK-NOTE-FORMAT: macro-backtrace.c +18:7: warning: // CHECK-NOTE-FORMAT: macro-backtrace.c +15:19: note: // CHECK-NOTE-FORMAT: macro-backtrace.c +14:19: note: // CHECK-NOTE-FORMAT: note: // CHECK-NOTE-FORMAT: macro-backtrace.c +6:18: note: // CHECK-NOTE-FORMAT: macro-backtrace.c +5:18: note: // CHECK-NOTE-FORMAT: macro-backtrace.c +4:23: note: }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-lookups.cpp
// RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s namespace Test { extern int a; int a = 0; } namespace Test { } // DECLS: Dumping Test: // DECLS-NEXT: NamespaceDecl {{.*}} Test // DECLS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern // DECLS-NEXT: `-VarDecl {{.*}} prev [[EXTERN_A]] {{.*}} a 'int' cinit // DECLS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 // // DECLS: Dumping Test: // DECLS-NEXT: NamespaceDecl {{.*}} Test // LOOKUPS: Dumping Test: // LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' // LOOKUPS-NEXT: `-DeclarationName 'a' // LOOKUPS-NEXT: `-Var {{.*}} 'a' 'int' // // LOOKUPS: Dumping Test: // LOOKUPS-NEXT: Lookup map is in primary DeclContext // DECLS-LOOKUPS: Dumping Test: // DECLS-LOOKUPS-NEXT: StoredDeclsMap Namespace {{.*}} 'Test' // DECLS-LOOKUPS-NEXT: `-DeclarationName 'a' // DECLS-LOOKUPS-NEXT: `-Var [[A:[^ ]*]] 'a' 'int' // DECLS-LOOKUPS-NEXT: |-VarDecl [[EXTERN_A:0x[^ ]*]] {{.*}} a 'int' extern // DECLS-LOOKUPS-NEXT: `-VarDecl [[A]] prev [[EXTERN_A]] {{.*}} a 'int' cinit // DECLS-LOOKUPS-NEXT: `-IntegerLiteral {{.*}} 'int' 0 // // DECLS-LOOKUPS: Dumping Test: // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-driver.c
// Test that the driver correctly combines its own diagnostics with CC1's in the // serialized diagnostics. To test this, we need to trigger diagnostics from // both processes, so we compile code that has a warning (with an associated // note) and then force the driver to crash. We compile stdin so that the crash // doesn't litter the user's system with preprocessed output. // RUN: rm -f %t // RUN: %clang -Wx-unknown-warning -Wall -fsyntax-only --serialize-diagnostics %t.diag %s // RUN: c-index-test -read-diagnostics %t.diag 2>&1 | FileCheck %s // CHECK: warning: unknown warning option '-Wx-unknown-warning' [-Wunknown-warning-option] [] // CHECK: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized] // CHECK: note: initialize the variable 'voodoo' to silence this warning [] // CHECK: Number of diagnostics: 2 void foo() { int voodoo; voodoo = voodoo + 1; }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-decl.cpp
// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s class testEnumDecl { enum class TestEnumDeclScoped; enum TestEnumDeclFixed : int; }; // CHECK: EnumDecl{{.*}} class TestEnumDeclScoped 'int' // CHECK: EnumDecl{{.*}} TestEnumDeclFixed 'int' class testFieldDecl { int TestFieldDeclInit = 0; }; // CHECK: FieldDecl{{.*}} TestFieldDeclInit 'int' // CHECK-NEXT: IntegerLiteral namespace testVarDeclNRVO { class A { }; A foo() { A TestVarDeclNRVO; return TestVarDeclNRVO; } } // CHECK: VarDecl{{.*}} TestVarDeclNRVO 'class testVarDeclNRVO::A' nrvo void testParmVarDeclInit(int TestParmVarDeclInit = 0); // CHECK: ParmVarDecl{{.*}} TestParmVarDeclInit 'int' // CHECK-NEXT: IntegerLiteral{{.*}} namespace TestNamespaceDecl { int i; } // CHECK: NamespaceDecl{{.*}} TestNamespaceDecl // CHECK-NEXT: VarDecl namespace TestNamespaceDecl { int j; } // CHECK: NamespaceDecl{{.*}} TestNamespaceDecl // CHECK-NEXT: original Namespace // CHECK-NEXT: VarDecl inline namespace TestNamespaceDeclInline { } // CHECK: NamespaceDecl{{.*}} TestNamespaceDeclInline inline namespace testUsingDirectiveDecl { namespace A { } } namespace TestUsingDirectiveDecl { using namespace testUsingDirectiveDecl::A; } // CHECK: NamespaceDecl{{.*}} TestUsingDirectiveDecl // CHECK-NEXT: UsingDirectiveDecl{{.*}} Namespace{{.*}} 'A' namespace testNamespaceAlias { namespace A { } } namespace TestNamespaceAlias = testNamespaceAlias::A; // CHECK: NamespaceAliasDecl{{.*}} TestNamespaceAlias // CHECK-NEXT: Namespace{{.*}} 'A' using TestTypeAliasDecl = int; // CHECK: TypeAliasDecl{{.*}} TestTypeAliasDecl 'int' namespace testTypeAliasTemplateDecl { template<typename T> class A; template<typename T> using TestTypeAliasTemplateDecl = A<T>; } // CHECK: TypeAliasTemplateDecl{{.*}} TestTypeAliasTemplateDecl // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: TypeAliasDecl{{.*}} TestTypeAliasTemplateDecl 'A<T>' namespace testCXXRecordDecl { class A { }; class B { }; class TestCXXRecordDecl : virtual A, public B { int i; }; } // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDecl // CHECK-NEXT: virtual private 'class testCXXRecordDecl::A' // CHECK-NEXT: public 'class testCXXRecordDecl::B' // CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDecl // CHECK-NEXT: FieldDecl template<class...T> class TestCXXRecordDeclPack : public T... { }; // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack // CHECK-NEXT: public 'T'... // CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack thread_local int TestThreadLocalInt; // CHECK: TestThreadLocalInt {{.*}} tls_dynamic __module_private__ class TestCXXRecordDeclPrivate; // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPrivate __module_private__ class testCXXMethodDecl { __module_private__ void TestCXXMethodDeclPrivate(); virtual void TestCXXMethodDeclPure() = 0; void TestCXXMethodDeclDelete() = delete; void TestCXXMethodDeclThrow() throw(); void TestCXXMethodDeclThrowType() throw(int); }; // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPrivate 'void (void)' __module_private__ // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPure 'void (void)' virtual pure // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclDelete 'void (void)' delete // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrow 'void (void) throw()' // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrowType 'void (void) throw(int)' namespace testCXXConstructorDecl { class A { }; class TestCXXConstructorDecl : public A { int I; TestCXXConstructorDecl(A &a, int i) : A(a), I(i) { } TestCXXConstructorDecl(A &a) : TestCXXConstructorDecl(a, 0) { } }; } // CHECK: CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}' // CHECK-NEXT: ParmVarDecl{{.*}} a // CHECK-NEXT: ParmVarDecl{{.*}} i // CHECK-NEXT: CXXCtorInitializer{{.*}}A // CHECK-NEXT: Expr // CHECK: CXXCtorInitializer{{.*}}I // CHECK-NEXT: Expr // CHECK: CompoundStmt // CHECK: CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}' // CHECK-NEXT: ParmVarDecl{{.*}} a // CHECK-NEXT: CXXCtorInitializer{{.*}}TestCXXConstructorDecl // CHECK-NEXT: CXXConstructExpr{{.*}}TestCXXConstructorDecl class TestCXXDestructorDecl { ~TestCXXDestructorDecl() { } }; // CHECK: CXXDestructorDecl{{.*}} ~TestCXXDestructorDecl 'void (void) noexcept' // CHECK-NEXT: CompoundStmt // Test that the range of a defaulted members is computed correctly. class TestMemberRanges { public: TestMemberRanges() = default; TestMemberRanges(const TestMemberRanges &Other) = default; TestMemberRanges(TestMemberRanges &&Other) = default; ~TestMemberRanges() = default; TestMemberRanges &operator=(const TestMemberRanges &Other) = default; TestMemberRanges &operator=(TestMemberRanges &&Other) = default; }; void SomeFunction() { TestMemberRanges A; TestMemberRanges B(A); B = A; A = static_cast<TestMemberRanges &&>(B); TestMemberRanges C(static_cast<TestMemberRanges &&>(A)); } // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:30> // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:59> // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:54> // CHECK: CXXDestructorDecl{{.*}} <line:{{.*}}:3, col:31> // CHECK: CXXMethodDecl{{.*}} <line:{{.*}}:3, col:70> // CHECK: CXXMethodDecl{{.*}} <line:{{.*}}:3, col:65> class TestCXXConversionDecl { operator int() { return 0; } }; // CHECK: CXXConversionDecl{{.*}} operator int 'int (void)' // CHECK-NEXT: CompoundStmt namespace TestStaticAssertDecl { static_assert(true, "msg"); } // CHECK: NamespaceDecl{{.*}} TestStaticAssertDecl // CHECK-NEXT: StaticAssertDecl{{.*> .*$}} // CHECK-NEXT: CXXBoolLiteralExpr // CHECK-NEXT: StringLiteral namespace testFunctionTemplateDecl { class A { }; class B { }; class C { }; class D { }; template<typename T> void TestFunctionTemplate(T) { } // implicit instantiation void bar(A a) { TestFunctionTemplate(a); } // explicit specialization template<> void TestFunctionTemplate(B); // explicit instantiation declaration extern template void TestFunctionTemplate(C); // explicit instantiation definition template void TestFunctionTemplate(D); } // CHECK: FunctionTemplateDecl{{.*}} TestFunctionTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)' // CHECK-NEXT: ParmVarDecl{{.*}} 'T' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl // CHECK-NEXT: CompoundStmt // CHECK-NEXT: Function{{.*}} 'TestFunctionTemplate' {{.*}}B // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}C // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}D // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl // CHECK-NEXT: CompoundStmt // CHECK: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}B // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl namespace testClassTemplateDecl { class A { }; class B { }; class C { }; class D { }; template<typename T> class TestClassTemplate { int i; }; // implicit instantiation TestClassTemplate<A> a; // explicit specialization template<> class TestClassTemplate<B> { int j; }; // explicit instantiation declaration extern template class TestClassTemplate<C>; // explicit instantiation definition template class TestClassTemplate<D>; // partial explicit specialization template<typename T1, typename T2> class TestClassTemplatePartial { int i; }; template<typename T1> class TestClassTemplatePartial<T1, A> { int j; }; } // CHECK: ClassTemplateDecl{{.*}} TestClassTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FieldDecl{{.*}} i // CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}A // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' // CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' // CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' // CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}B // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FieldDecl{{.*}} j // CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}C // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}D // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class TestClassTemplatePartial // CHECK-NEXT: TemplateArgument // CHECK-NEXT: TemplateArgument{{.*}}A // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplatePartial // CHECK-NEXT: FieldDecl{{.*}} j // PR15220 dump instantiation only once namespace testCanonicalTemplate { class A {}; template<typename T> void TestFunctionTemplate(T); template<typename T> void TestFunctionTemplate(T); void bar(A a) { TestFunctionTemplate(a); } // CHECK: FunctionTemplateDecl{{.*}} TestFunctionTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)' // CHECK-NEXT: ParmVarDecl{{.*}} 'T' // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A // CHECK-NEXT: TemplateArgument // CHECK-NEXT: ParmVarDecl // CHECK: FunctionTemplateDecl{{.*}} TestFunctionTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)' // CHECK-NEXT: ParmVarDecl{{.*}} 'T' // CHECK-NEXT: Function{{.*}} 'TestFunctionTemplate' // CHECK-NOT: TemplateArgument template<typename T1> class TestClassTemplate { template<typename T2> friend class TestClassTemplate; }; TestClassTemplate<A> a; // CHECK: ClassTemplateDecl{{.*}} TestClassTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: FriendDecl // CHECK-NEXT: ClassTemplateDecl{{.*}} TestClassTemplate // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' // CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}A // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate } template <class T> class TestClassScopeFunctionSpecialization { template<class U> void foo(U a) { } template<> void foo<int>(int a) { } }; // CHECK: ClassScopeFunctionSpecializationDecl // CHECK-NEXT: CXXMethod{{.*}} 'foo' 'void (int)' // CHECK-NEXT: TemplateArgument{{.*}} 'int' namespace TestTemplateTypeParmDecl { template<typename ... T, class U = int> void foo(); } // CHECK: NamespaceDecl{{.*}} TestTemplateTypeParmDecl // CHECK-NEXT: FunctionTemplateDecl // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename ... T // CHECK-NEXT: TemplateTypeParmDecl{{.*}} class U // CHECK-NEXT: TemplateArgument type 'int' namespace TestNonTypeTemplateParmDecl { template<int I = 1, int ... J> void foo(); } // CHECK: NamespaceDecl{{.*}} TestNonTypeTemplateParmDecl // CHECK-NEXT: FunctionTemplateDecl // CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' I // CHECK-NEXT: TemplateArgument expr // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 1 // CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' ... J namespace TestTemplateTemplateParmDecl { template<typename T> class A; template <template <typename> class T = A, template <typename> class ... U> void foo(); } // CHECK: NamespaceDecl{{.*}} TestTemplateTemplateParmDecl // CHECK: FunctionTemplateDecl // CHECK-NEXT: TemplateTemplateParmDecl{{.*}} T // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename // CHECK-NEXT: TemplateArgument{{.*}} template A // CHECK-NEXT: TemplateTemplateParmDecl{{.*}} ... U // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename namespace TestTemplateArgument { template<typename> class A { }; template<template<typename> class ...> class B { }; int foo(); template<typename> class testType { }; template class testType<int>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testType // CHECK-NEXT: TemplateArgument{{.*}} type 'int' template<int fp(void)> class testDecl { }; template class testDecl<foo>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl // CHECK-NEXT: TemplateArgument{{.*}} decl // CHECK-NEXT: Function{{.*}}foo template class testDecl<nullptr>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl // CHECK-NEXT: TemplateArgument{{.*}} nullptr template<int> class testIntegral { }; template class testIntegral<1>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testIntegral // CHECK-NEXT: TemplateArgument{{.*}} integral 1 template<template<typename> class> class testTemplate { }; template class testTemplate<A>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testTemplate // CHECK-NEXT: TemplateArgument{{.*}} A template<template<typename> class ...T> class C { B<T...> testTemplateExpansion; }; // FIXME: Need TemplateSpecializationType dumping to test TemplateExpansion. template<int, int = 0> class testExpr; template<int I> class testExpr<I> { }; // CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class testExpr // CHECK-NEXT: TemplateArgument{{.*}} expr // CHECK-NEXT: DeclRefExpr{{.*}}I template<int, int ...> class testPack { }; template class testPack<0, 1, 2>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testPack // CHECK-NEXT: TemplateArgument{{.*}} integral 0 // CHECK-NEXT: TemplateArgument{{.*}} pack // CHECK-NEXT: TemplateArgument{{.*}} integral 1 // CHECK-NEXT: TemplateArgument{{.*}} integral 2 } namespace testUsingDecl { int i; } namespace TestUsingDecl { using testUsingDecl::i; } // CHECK: NamespaceDecl{{.*}} TestUsingDecl // CHECK-NEXT: UsingDecl{{.*}} testUsingDecl::i // CHECK-NEXT: UsingShadowDecl{{.*}} Var{{.*}} 'i' 'int' namespace testUnresolvedUsing { class A { }; template<class T> class B { public: A a; }; template<class T> class TestUnresolvedUsing : public B<T> { using typename B<T>::a; using B<T>::a; }; } // CHECK: CXXRecordDecl{{.*}} TestUnresolvedUsing // CHECK: UnresolvedUsingTypenameDecl{{.*}} B<T>::a // CHECK: UnresolvedUsingValueDecl{{.*}} B<T>::a namespace TestLinkageSpecDecl { extern "C" void test1(); extern "C++" void test2(); } // CHECK: NamespaceDecl{{.*}} TestLinkageSpecDecl // CHECK-NEXT: LinkageSpecDecl{{.*}} C // CHECK-NEXT: FunctionDecl // CHECK-NEXT: LinkageSpecDecl{{.*}} C++ // CHECK-NEXT: FunctionDecl class TestAccessSpecDecl { public: private: protected: }; // CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestAccessSpecDecl // CHECK-NEXT: AccessSpecDecl{{.*}} public // CHECK-NEXT: AccessSpecDecl{{.*}} private // CHECK-NEXT: AccessSpecDecl{{.*}} protected template<typename T> class TestFriendDecl { friend int foo(); friend class A; friend T; }; // CHECK: CXXRecord{{.*}} TestFriendDecl // CHECK-NEXT: CXXRecord{{.*}} TestFriendDecl // CHECK-NEXT: FriendDecl // CHECK-NEXT: FunctionDecl{{.*}} foo // CHECK-NEXT: FriendDecl{{.*}} 'class A':'class A' // CHECK-NEXT: FriendDecl{{.*}} 'T' namespace TestFileScopeAsmDecl { asm("ret"); } // CHECK: NamespaceDecl{{.*}} TestFileScopeAsmDecl{{$}} // CHECK: FileScopeAsmDecl{{.*> .*$}} // CHECK-NEXT: StringLiteral namespace TestFriendDecl2 { void f(); struct S { friend void f(); }; } // CHECK: NamespaceDecl [[TestFriendDecl2:0x.*]] <{{.*}}> {{.*}} TestFriendDecl2 // CHECK: |-FunctionDecl [[TestFriendDecl2_f:0x.*]] <{{.*}}> {{.*}} f 'void (void)' // CHECK: `-CXXRecordDecl {{.*}} struct S // CHECK: |-CXXRecordDecl {{.*}} struct S // CHECK: `-FriendDecl // CHECK: `-FunctionDecl {{.*}} parent [[TestFriendDecl2]] prev [[TestFriendDecl2_f]] <{{.*}}> {{.*}} f 'void (void)' namespace Comment { extern int Test; /// Something here. extern int Test; extern int Test; } // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK-NOT: FullComment // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK: `-FullComment // CHECK: `-ParagraphComment // CHECK: `-TextComment // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK-NOT: FullComment
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-macro-backtrace.c
// RUN: not %clang -fsyntax-only -fmacro-backtrace-limit=0 %s 2>&1 | FileCheck %s #define FOO 1+"hi" #define BAR FOO #define BAZ BAR #define QUZ BAZ #define TAZ QUZ #define ABA TAZ #define BAB ABA #define ZAZ BAB #define WAZ ZAZ #define DROOL WAZ #define FOOL DROOL FOOL; // CHECK: :15:1: error: expected identifier or '(' // CHECK: FOOL // CHECK: ^ // CHECK: :13:14: note: expanded from macro 'FOOL' // CHECK: #define FOOL DROOL // CHECK: ^ // CHECK: :12:15: note: expanded from macro 'DROOL' // CHECK: #define DROOL WAZ // CHECK: ^ // CHECK: :11:13: note: expanded from macro 'WAZ' // CHECK: #define WAZ ZAZ // CHECK: ^ // CHECK: :10:13: note: expanded from macro 'ZAZ' // CHECK: #define ZAZ BAB // CHECK: ^ // CHECK: :9:13: note: expanded from macro 'BAB' // CHECK: #define BAB ABA // CHECK: ^ // CHECK: :8:13: note: expanded from macro 'ABA' // CHECK: #define ABA TAZ // CHECK: ^ // CHECK: :7:13: note: expanded from macro 'TAZ' // CHECK: #define TAZ QUZ // CHECK: ^ // CHECK: :6:13: note: expanded from macro 'QUZ' // CHECK: #define QUZ BAZ // CHECK: ^ // CHECK: :5:13: note: expanded from macro 'BAZ' // CHECK: #define BAZ BAR // CHECK: ^ // CHECK: :4:13: note: expanded from macro 'BAR' // CHECK: #define BAR FOO // CHECK: ^ // CHECK: :3:13: note: expanded from macro 'FOO' // CHECK: #define FOO 1+"hi" // CHECK: ^ #define ADD(a, b) a ## #b ADD(L, foo) // CHECK: error: expected identifier or '(' // CHECK: ADD(L, foo) // CHECK: {{^\^}} // CHECK: note: expanded from macro 'ADD' // CHECK: #define ADD(a, b) a ## #b // CHECK: {{^ \^}} // CHECK: note: expanded from here // CHECK: L"foo" // CHECK: {{^\^}} // CHECK: 2 errors generated.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/warn-sysheader.cpp
// Test that -Wsystem-headers works with default and custom mappings like -Werror. // Keep run lines at the bottom for line number stability. #ifdef IS_SYSHEADER #pragma clang system_header int f() { return (int)0; } // Use the old-style-cast warning as an arbitrary "ordinary" diagnostic for the purpose of testing. #warning "custom message" #if defined(A) || defined(B) // expected-warning@9 {{"custom message"}} #elif defined(C) // expected-warning@7 {{use of old-style cast}} // expected-warning@9 {{"custom message"}} #elif defined(D) // expected-error@7 {{use of old-style cast}} // expected-error@9 {{"custom message"}} #elif defined(E) // expected-error@7 {{use of old-style cast}} // expected-warning@9 {{"custom message"}} #endif #else #define IS_SYSHEADER #include __FILE__ #endif // RUN: %clang_cc1 -verify -fsyntax-only -DA %s // RUN: %clang_cc1 -verify -fsyntax-only -DB -Wold-style-cast %s // RUN: %clang_cc1 -verify -fsyntax-only -DC -Wold-style-cast -Wsystem-headers %s // RUN: %clang_cc1 -verify -fsyntax-only -DD -Wold-style-cast -Wsystem-headers -Werror %s // RUN: %clang_cc1 -verify -fsyntax-only -DE -Wold-style-cast -Wsystem-headers -Werror=old-style-cast %s
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/show-diag-options.c
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=BASE // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=OPTION // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-option -Werror %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=OPTION_ERROR // RUN: %clang_cc1 -fsyntax-only -std=c89 -pedantic -fdiagnostics-show-option %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=OPTION_PEDANTIC // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-category id %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=CATEGORY_ID // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-category name %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=CATEGORY_NAME // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-option -fdiagnostics-show-category name -Werror %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=OPTION_ERROR_CATEGORY void test(int x, int y) { if (x = y) ++x; // BASE: {{.*}}: warning: {{[a-z ]+$}} // OPTION: {{.*}}: warning: {{[a-z ]+}} [-Wparentheses] // OPTION_ERROR: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses] // CATEGORY_ID: {{.*}}: warning: {{[a-z ]+}} [2] // CATEGORY_NAME: {{.*}}: warning: {{[a-z ]+}} [Semantic Issue] // OPTION_ERROR_CATEGORY: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses,Semantic Issue] // Leverage the fact that all these '//'s get warned about in C89 pedantic. // OPTION_PEDANTIC: {{.*}}: warning: {{[/a-z ]+}} [-Wcomment] }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-attr.cpp
// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++11 -Wno-deprecated-declarations -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s int TestLocation __attribute__((unused)); // CHECK: VarDecl{{.*}}TestLocation // CHECK-NEXT: UnusedAttr 0x{{[^ ]*}} <line:[[@LINE-2]]:16> int TestIndent __attribute__((unused)); // CHECK: {{^}}VarDecl{{.*TestIndent[^()]*$}} // CHECK-NEXT: {{^}}`-UnusedAttr{{[^()]*$}} void TestAttributedStmt() { switch (1) { case 1: [[clang::fallthrough]]; case 2: ; } } // CHECK: FunctionDecl{{.*}}TestAttributedStmt // CHECK: AttributedStmt // CHECK-NEXT: FallThroughAttr // CHECK-NEXT: NullStmt [[clang::warn_unused_result]] int TestCXX11DeclAttr(); // CHECK: FunctionDecl{{.*}}TestCXX11DeclAttr // CHECK-NEXT: WarnUnusedResultAttr int TestAlignedNull __attribute__((aligned)); // CHECK: VarDecl{{.*}}TestAlignedNull // CHECK-NEXT: AlignedAttr {{.*}} aligned // CHECK-NEXT: <<<NULL>>> int TestAlignedExpr __attribute__((aligned(4))); // CHECK: VarDecl{{.*}}TestAlignedExpr // CHECK-NEXT: AlignedAttr {{.*}} aligned // CHECK-NEXT: IntegerLiteral int TestEnum __attribute__((visibility("default"))); // CHECK: VarDecl{{.*}}TestEnum // CHECK-NEXT: VisibilityAttr{{.*}} Default class __attribute__((lockable)) Mutex { } mu1, mu2; int TestExpr __attribute__((guarded_by(mu1))); // CHECK: VarDecl{{.*}}TestExpr // CHECK-NEXT: GuardedByAttr // CHECK-NEXT: DeclRefExpr{{.*}}mu1 class Mutex TestVariadicExpr __attribute__((acquired_after(mu1, mu2))); // CHECK: VarDecl{{.*}}TestVariadicExpr // CHECK: AcquiredAfterAttr // CHECK-NEXT: DeclRefExpr{{.*}}mu1 // CHECK-NEXT: DeclRefExpr{{.*}}mu2 void function1(void *) { int TestFunction __attribute__((cleanup(function1))); } // CHECK: VarDecl{{.*}}TestFunction // CHECK-NEXT: CleanupAttr{{.*}} Function{{.*}}function1 void TestIdentifier(void *, int) __attribute__((pointer_with_type_tag(ident1,1,2))); // CHECK: FunctionDecl{{.*}}TestIdentifier // CHECK: ArgumentWithTypeTagAttr{{.*}} pointer_with_type_tag ident1 void TestBool(void *, int) __attribute__((pointer_with_type_tag(bool1,1,2))); // CHECK: FunctionDecl{{.*}}TestBool // CHECK: ArgumentWithTypeTagAttr{{.*}}pointer_with_type_tag bool1 0 1 IsPointer void TestUnsigned(void *, int) __attribute__((pointer_with_type_tag(unsigned1,1,2))); // CHECK: FunctionDecl{{.*}}TestUnsigned // CHECK: ArgumentWithTypeTagAttr{{.*}} pointer_with_type_tag unsigned1 0 1 void TestInt(void) __attribute__((constructor(123))); // CHECK: FunctionDecl{{.*}}TestInt // CHECK-NEXT: ConstructorAttr{{.*}} 123 static int TestString __attribute__((alias("alias1"))); // CHECK: VarDecl{{.*}}TestString // CHECK-NEXT: AliasAttr{{.*}} "alias1" extern struct s1 TestType __attribute__((type_tag_for_datatype(ident1,int))); // CHECK: VarDecl{{.*}}TestType // CHECK-NEXT: TypeTagForDatatypeAttr{{.*}} int void TestLabel() { L: __attribute__((unused)) int i; // CHECK: LabelStmt{{.*}}'L' // CHECK: VarDecl{{.*}}i 'int' // CHECK-NEXT: UnusedAttr{{.*}} M: __attribute(()) int j; // CHECK: LabelStmt {{.*}} 'M' // CHECK-NEXT: DeclStmt // CHECK-NEXT: VarDecl {{.*}} j 'int' N: __attribute(()) ; // CHECK: LabelStmt {{.*}} 'N' // CHECK-NEXT: NullStmt } namespace Test { extern "C" int printf(const char *format, ...); // CHECK: FunctionDecl{{.*}}printf // CHECK-NEXT: ParmVarDecl{{.*}}format{{.*}}'const char *' // CHECK-NEXT: FormatAttr{{.*}}Implicit printf 1 2 alignas(8) extern int x; extern int x; // CHECK: VarDecl{{.*}} x 'int' // CHECK: VarDecl{{.*}} x 'int' // CHECK-NEXT: AlignedAttr{{.*}} Inherited } int __attribute__((cdecl)) TestOne(void), TestTwo(void); // CHECK: FunctionDecl{{.*}}TestOne{{.*}}__attribute__((cdecl)) // CHECK: FunctionDecl{{.*}}TestTwo{{.*}}__attribute__((cdecl)) void func() { auto Test = []() __attribute__((no_thread_safety_analysis)) {}; // CHECK: CXXMethodDecl{{.*}}operator() 'void (void) const' // CHECK: NoThreadSafetyAnalysisAttr // Because GNU's noreturn applies to the function type, and this lambda does // not have a capture list, the call operator and the function pointer // conversion should both be noreturn, but the method should not contain a // NoReturnAttr because the attribute applied to the type. auto Test2 = []() __attribute__((noreturn)) { while(1); }; // CHECK: CXXMethodDecl{{.*}}operator() 'void (void) __attribute__((noreturn)) const' // CHECK-NOT: NoReturnAttr // CHECK: CXXConversionDecl{{.*}}operator void (*)() __attribute__((noreturn)) } namespace PR20930 { struct S { struct { int Test __attribute__((deprecated)); }; // CHECK: FieldDecl{{.*}}Test 'int' // CHECK-NEXT: DeprecatedAttr }; void f() { S s; s.Test = 1; // CHECK: IndirectFieldDecl{{.*}}Test 'int' // CHECK: DeprecatedAttr } }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/working-directory.c
// RUN: %clang_cc1 -working-directory %S working-directory.c -IInputs -fsyntax-only #include "working-directory.h" Foo bar;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/include-stack-for-note-flag.cpp
// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK // RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS // RUN: not %clang_cc1 -fsyntax-only -fno-diagnostics-show-note-include-stack -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACK // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-show-note-include-stack -fno-diagnostics-show-note-include-stack %s 2>&1 | FileCheck %s -check-prefix=STACKLESS // RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=STACKLESS #include "Inputs/include.h" int test() { return foo(1, 1); } bool macro(int x, int y) { return EQUALS(&x, y); } // STACK: error: no matching function for call to 'foo' // STACK: In file included from // STACK: note: candidate function not viable // STACK: error: comparison between pointer and integer // STACK: In file included from // STACK: note: expanded from macro // STACKLESS: error: no matching function for call to 'foo' // STACKLESS-NOT: In file included from // STACKLESS: note: candidate function not viable // STACKLESS: error: comparison between pointer and integer // STACKLESS-NOT: In file included from // STACKLESS: note: expanded from macro
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-template-diffing.cpp
// RUN: not %clang_cc1 -fsyntax-only %s -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-NOTREE // RUN: not %clang_cc1 -fsyntax-only %s -fno-elide-type -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-NOTREE // RUN: not %clang_cc1 -fsyntax-only %s -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-TREE // RUN: not %clang_cc1 -fsyntax-only %s -fno-elide-type -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-TREE // PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'" // vector<string> refers to two different types here. Make sure the message // gives a way to tell them apart. class versa_string; typedef versa_string string; namespace std {template <typename T> class vector;} using std::vector; void f(vector<string> v); namespace std { class basic_string; typedef basic_string string; template <typename T> class vector {}; void g() { vector<string> v; f(v); } } // end namespace std // CHECK-ELIDE-NOTREE: no matching function for call to 'f' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<std::basic_string>' to 'vector<versa_string>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<std::basic_string>' to 'vector<versa_string>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [std::basic_string != versa_string]> // CHECK-NOELIDE-TREE: no matching function for call to 'f' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [std::basic_string != versa_string]> template <int... A> class I1{}; void set1(I1<1,2,3,4,2,3,4,3>) {}; void test1() { set1(I1<1,2,3,4,2,2,4,3,7>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set1' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<[5 * ...], 2, [2 * ...], 7>' to 'I1<[5 * ...], 3, [2 * ...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set1' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<1, 2, 3, 4, 2, 2, 4, 3, 7>' to 'I1<1, 2, 3, 4, 2, 3, 4, 3, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set1' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: I1< // CHECK-ELIDE-TREE: [5 * ...], // CHECK-ELIDE-TREE: [2 != 3], // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [7 != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set1' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: I1< // CHECK-NOELIDE-TREE: 1, // CHECK-NOELIDE-TREE: 2, // CHECK-NOELIDE-TREE: 3, // CHECK-NOELIDE-TREE: 4, // CHECK-NOELIDE-TREE: 2, // CHECK-NOELIDE-TREE: [2 != 3], // CHECK-NOELIDE-TREE: 4, // CHECK-NOELIDE-TREE: 3, // CHECK-NOELIDE-TREE: [7 != (no argument)]> template <class A, class B, class C = void> class I2{}; void set2(I2<int, int>) {}; void test2() { set2(I2<double, int, int>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set2' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, [...], int>' to 'I2<int, [...], (default) void>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set2' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, int, int>' to 'I2<int, int, (default) void>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set2' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: I2< // CHECK-ELIDE-TREE: [double != int], // CHECK-ELIDE-TREE: [...], // CHECK-ELIDE-TREE: [int != (default) void]> // CHECK-NOELIDE-TREE: no matching function for call to 'set2' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: I2< // CHECK-NOELIDE-TREE: [double != int], // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: [int != (default) void]> int V1, V2, V3; template <int* A, int *B> class I3{}; void set3(I3<&V1, &V2>) {}; void test3() { set3(I3<&V3, &V2>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set3' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, [...]>' to 'I3<&V1, [...]>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set3' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, &V2>' to 'I3<&V1, &V2>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set3' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: I3< // CHECK-ELIDE-TREE: [&V3 != &V1] // CHECK-ELIDE-TREE: [...]> // CHECK-NOELIDE-TREE: no matching function for call to 'set3' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: I3< // CHECK-NOELIDE-TREE: [&V3 != &V1] // CHECK-NOELIDE-TREE: &V2> template <class A, class B> class Alpha{}; template <class A, class B> class Beta{}; template <class A, class B> class Gamma{}; template <class A, class B> class Delta{}; void set4(Alpha<int, int>); void test4() { set4(Beta<void, void>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set4' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set4' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set4' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument // CHECK-NOELIDE-TREE: no matching function for call to 'set4' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument void set5(Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>); void test5() { set5(Alpha<Beta<Gamma<void, void>, double>, double>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set5' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set5' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set5' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Alpha< // CHECK-ELIDE-TREE: Beta< // CHECK-ELIDE-TREE: Gamma< // CHECK-ELIDE-TREE: [void != Delta<int, int>], // CHECK-ELIDE-TREE: [void != int]> // CHECK-ELIDE-TREE: [double != int]> // CHECK-ELIDE-TREE: [double != int]> // CHECK-NOELIDE-TREE: no matching function for call to 'set5' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Alpha< // CHECK-NOELIDE-TREE: Beta< // CHECK-NOELIDE-TREE: Gamma< // CHECK-NOELIDE-TREE: [void != Delta<int, int>], // CHECK-NOELIDE-TREE: [void != int]> // CHECK-NOELIDE-TREE: [double != int]> // CHECK-NOELIDE-TREE: [double != int]> void test6() { set5(Alpha<Beta<Delta<int, int>, int>, int>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set5' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, [...]>, [...]>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, [...]>, [...]>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set5' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, int>, int>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set5' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Alpha< // CHECK-ELIDE-TREE: Beta< // CHECK-ELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>], // CHECK-ELIDE-TREE: [...]> // CHECK-ELIDE-TREE: [...]> // CHECK-NOELIDE-TREE: no matching function for call to 'set5' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Alpha< // CHECK-NOELIDE-TREE: Beta< // CHECK-NOELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>], // CHECK-NOELIDE-TREE: int> // CHECK-NOELIDE-TREE: int> int a7, b7; int c7[] = {1,2,3}; template<int *A> class class7 {}; void set7(class7<&a7> A) {} void test7() { set7(class7<&a7>()); set7(class7<&b7>()); set7(class7<c7>()); set7(class7<nullptr>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set7' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [&b7 != &a7]> // CHECK-ELIDE-TREE: no matching function for call to 'set7' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [c7 != &a7]> // CHECK-ELIDE-TREE: no matching function for call to 'set7' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [nullptr != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [&b7 != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [c7 != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [nullptr != &a7]> template<typename ...T> struct S8 {}; template<typename T> using U8 = S8<int, char, T>; int f8(S8<int, char, double>); int k8 = f8(U8<char>()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f8' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<[2 * ...], char>' to 'S8<[2 * ...], double>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f8' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<int, char, char>' to 'S8<int, char, double>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f8' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: S8< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [char != double]> // CHECK-NOELIDE-TREE: no matching function for call to 'f8' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: S8< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: char, // CHECK-NOELIDE-TREE: [char != double]> template<typename ...T> struct S9 {}; template<typename T> using U9 = S9<int, char, T>; template<typename T> using V9 = U9<U9<T>>; int f9(S9<int, char, U9<const double>>); int k9 = f9(V9<double>()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f9' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<[2 * ...], S9<[2 * ...], double>>' to 'S9<[2 * ...], S9<[2 * ...], const double>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f9' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<int, char, S9<int, char, double>>' to 'S9<int, char, S9<int, char, const double>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f9' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: S9< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: S9< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [double != const double]>> // CHECK-NOELIDE-TREE: no matching function for call to 'f9' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: S9< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: char, // CHECK-NOELIDE-TREE: S9< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: char, // CHECK-NOELIDE-TREE: [double != const double]>> template<typename ...A> class class_types {}; void set10(class_types<int, int>) {} void test10() { set10(class_types<int>()); set10(class_types<int, int, int>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set10' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[...], (no argument)>' to 'class_types<[...], int>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set10' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[2 * ...], int>' to 'class_types<[2 * ...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, (no argument)>' to 'class_types<int, int>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, int, int>' to 'class_types<int, int, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set10' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_types< // CHECK-ELIDE-TREE: [...], // CHECK-ELIDE-TREE: [(no argument) != int]> // CHECK-ELIDE-TREE: no matching function for call to 'set10' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_types< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [int != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set10' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_types< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: [(no argument) != int]> // CHECK-NOELIDE-TREE: no matching function for call to 'set10' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_types< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: [int != (no argument)]> template<int ...A> class class_ints {}; void set11(class_ints<2, 3>) {} void test11() { set11(class_ints<1>()); set11(class_ints<0, 3, 6>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set11' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set11' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, [...], 6>' to 'class_ints<2, [...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, 3, 6>' to 'class_ints<2, 3, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set11' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_ints< // CHECK-ELIDE-TREE: [1 != 2], // CHECK-ELIDE-TREE: [(no argument) != 3]> // CHECK-ELIDE-TREE: no matching function for call to 'set11' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_ints< // CHECK-ELIDE-TREE: [0 != 2], // CHECK-ELIDE-TREE: [...], // CHECK-ELIDE-TREE: [6 != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set11' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_ints< // CHECK-NOELIDE-TREE: [1 != 2], // CHECK-NOELIDE-TREE: [(no argument) != 3]> // CHECK-NOELIDE-TREE: no matching function for call to 'set11' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_ints< // CHECK-NOELIDE-TREE: [0 != 2], // CHECK-NOELIDE-TREE: 3, // CHECK-NOELIDE-TREE: [6 != (no argument)]> template<template<class> class ...A> class class_template_templates {}; template<class> class tt1 {}; template<class> class tt2 {}; void set12(class_template_templates<tt1, tt1>) {} void test12() { set12(class_template_templates<tt2>()); set12(class_template_templates<tt1, tt1, tt1>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set12' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set12' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<[2 * ...], template tt1>' to 'class_template_templates<[2 * ...], template (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set12' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set12' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt1, template tt1, template tt1>' to 'class_template_templates<template tt1, template tt1, template (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set12' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_template_templates< // CHECK-ELIDE-TREE: [template tt2 != template tt1], // CHECK-ELIDE-TREE: [template (no argument) != template tt1]> // CHECK-ELIDE-TREE: no matching function for call to 'set12' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_template_templates< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [template tt1 != template (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set12' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_template_templates< // CHECK-NOELIDE-TREE: [template tt2 != template tt1], // CHECK-NOELIDE-TREE: [template (no argument) != template tt1]> // CHECK-NOELIDE-TREE: no matching function for call to 'set12' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_template_templates< // CHECK-NOELIDE-TREE: template tt1, // CHECK-NOELIDE-TREE: template tt1, // CHECK-NOELIDE-TREE: [template tt1 != template (no argument)]> double a13, b13, c13, d13; template<double* ...A> class class_ptrs {}; void set13(class_ptrs<&a13, &b13>) {} void test13() { set13(class_ptrs<&c13>()); set13(class_ptrss<&a13, &b13, &d13>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set13' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set13' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<[2 * ...], &d13>' to 'class_ptrs<[2 * ...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set13' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set13' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&a13, &b13, &d13>' to 'class_ptrs<&a13, &b13, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set13' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_ptrs< // CHECK-ELIDE-TREE: [&c13 != &a13], // CHECK-ELIDE-TREE: [(no argument) != &b13]> // CHECK-ELIDE-TREE: no matching function for call to 'set13' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: class_ptrs< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [&d13 != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set13' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_ptrs< // CHECK-NOELIDE-TREE: [&c13 != &a13], // CHECK-NOELIDE-TREE: [(no argument) != &b13]> // CHECK-NOELIDE-TREE: no matching function for call to 'set13' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: class_ptrs< // CHECK-NOELIDE-TREE: &a13, // CHECK-NOELIDE-TREE: &b13, // CHECK-NOELIDE-TREE: [&d13 != (no argument)]> template<typename T> struct s14 {}; template<typename T> using a14 = s14<T>; typedef a14<int> b14; template<typename T> using c14 = b14; int f14(c14<int>); int k14 = f14(a14<char>()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f14' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'a14<char>' to 'a14<int>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f14' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'a14<char>' to 'a14<int>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f14' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: a14< // CHECK-ELIDE-TREE: [char != int]> // CHECK-NOELIDE-TREE: no matching function for call to 'f14' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: a14< // CHECK-NOELIDE-TREE: [char != int]> void set15(vector<vector<int>>) {} void test15() { set15(vector<vector<int>>()); } // CHECK-ELIDE-NOTREE-NOT: set15 // CHECK-NOELIDE-NOTREE-NOT: set15 // CHECK-ELIDE-TREE-NOT: set15 // CHECK-NOELIDE-TREE-NOT: set15 // no error here void set16(vector<const vector<int>>) {} void test16() { set16(vector<const vector<const int>>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set16' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<const int>>' to 'vector<const vector<int>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set16' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<const int>>' to 'vector<const vector<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set16' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: const vector< // CHECK-ELIDE-TREE: [const != (no qualifiers)] int>> // CHECK-NOELIDE-TREE: no matching function for call to 'set16' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: const vector< // CHECK-NOELIDE-TREE: [const != (no qualifiers)] int>> void set17(vector<vector<int>>) {} void test17() { set17(vector<const vector<int>>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set17' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<vector<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set17' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<vector<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set17' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [const != (no qualifiers)] vector< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'set17' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [const != (no qualifiers)] vector< // CHECK-NOELIDE-TREE: int>> void set18(vector<const vector<int>>) {} void test18() { set18(vector<vector<int>>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set18' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<vector<[...]>>' to 'vector<const vector<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set18' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<vector<int>>' to 'vector<const vector<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set18' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [(no qualifiers) != const] vector< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'set18' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [(no qualifiers) != const] vector< // CHECK-NOELIDE-TREE: int>> void set19(vector<volatile vector<int>>) {} void test19() { set19(vector<const vector<int>>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set19' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<volatile vector<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set19' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<volatile vector<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set19' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [const != volatile] vector< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'set19' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [const != volatile] vector< // CHECK-NOELIDE-TREE: int>> void set20(vector<const volatile vector<int>>) {} void test20() { set20(vector<const vector<int>>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set20' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<[...]>>' to 'vector<const volatile vector<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set20' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<const vector<int>>' to 'vector<const volatile vector<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set20' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [const != const volatile] vector< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'set20' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [const != const volatile] vector< // CHECK-NOELIDE-TREE: int>> // Checks that volatile does not show up in diagnostics. template<typename T> struct S21 {}; template<typename T> using U21 = volatile S21<T>; int f21(vector<const U21<int>>); int k21 = f21(vector<U21<int>>()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f21' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U21<[...]>>' to 'vector<const U21<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f21' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U21<int>>' to 'vector<const U21<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f21' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [(no qualifiers) != const] U21< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'f21' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [(no qualifiers) != const] U21< // CHECK-NOELIDE-TREE: int>> // Checks that volatile does not show up in diagnostics. template<typename T> struct S22 {}; template<typename T> using U22 = volatile S22<T>; int f22(vector<volatile const U22<int>>); int k22 = f22(vector<volatile U22<int>>()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f22' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U22<[...]>>' to 'vector<const U22<[...]>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f22' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<U22<int>>' to 'vector<const U22<int>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f22' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: vector< // CHECK-ELIDE-TREE: [(no qualifiers) != const] U22< // CHECK-ELIDE-TREE: [...]>> // CHECK-NOELIDE-TREE: no matching function for call to 'f22' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: vector< // CHECK-NOELIDE-TREE: [(no qualifiers) != const] U22< // CHECK-NOELIDE-TREE: int>> // Testing qualifiers and typedefs. template <class T> struct D23{}; template <class T> using C23 = D23<T>; typedef const C23<int> B23; template<class ...T> using A23 = B23; void foo23(D23<A23<>> b) {} void test23() { foo23(D23<D23<char>>()); foo23(C23<char>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'foo23' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<D23<char>>' to 'D23<const D23<int>>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'foo23' // CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<char>' to 'D23<A23<>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'foo23' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<D23<char>>' to 'D23<const D23<int>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'foo23' // CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'D23<char>' to 'D23<A23<>>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'foo23' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: D23< // CHECK-ELIDE-TREE: [(no qualifiers) != const] D23< // CHECK-ELIDE-TREE: [char != int]>> // CHECK-ELIDE-TREE: no matching function for call to 'foo23' // CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: D23< // CHECK-ELIDE-TREE: [char != A23<>]> // CHECK-NOELIDE-TREE: no matching function for call to 'foo23' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: D23< // CHECK-NOELIDE-TREE: [(no qualifiers) != const] D23< // CHECK-NOELIDE-TREE: [char != int]>> // CHECK-NOELIDE-TREE: no matching function for call to 'foo23' // CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: D23< // CHECK-NOELIDE-TREE: [char != A23<>]> namespace PR14015 { template <unsigned N> class Foo1 {}; template <unsigned N = 2> class Foo2 {}; template <unsigned ...N> class Foo3 {}; void Play1() { Foo1<1> F1; Foo1<2> F2, F3; F2 = F1; F1 = F2; F2 = F3; F3 = F2; } // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<1>' to 'const Foo1<2>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<2>' to 'const Foo1<1>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<1>' to 'const Foo1<2>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<1>' to 'Foo1<2>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo1<2>' to 'const Foo1<1>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo1<2>' to 'Foo1<1>' for 1st argument // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo1< // CHECK-ELIDE-TREE: [1 != 2]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo1< // CHECK-ELIDE-TREE: [1 != 2]> // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo1< // CHECK-ELIDE-TREE: [2 != 1]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo1< // CHECK-ELIDE-TREE: [2 != 1]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo1< // CHECK-NOELIDE-TREE: [1 != 2]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo1< // CHECK-NOELIDE-TREE: [1 != 2]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo1< // CHECK-NOELIDE-TREE: [2 != 1]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo1< // CHECK-NOELIDE-TREE: [2 != 1]> void Play2() { Foo2<1> F1; Foo2<> F2, F3; F2 = F1; F1 = F2; F2 = F3; F3 = F2; } // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<1>' to 'const Foo2<2>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'const Foo2<1>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<1>' to 'const Foo2<2>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<1>' to 'Foo2<2>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'const Foo2<1>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo2<(default) 2>' to 'Foo2<1>' for 1st argument // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo2< // CHECK-ELIDE-TREE: [1 != 2]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo2< // CHECK-ELIDE-TREE: [1 != 2]> // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo2< // CHECK-ELIDE-TREE: [(default) 2 != 1]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo2< // CHECK-ELIDE-TREE: [(default) 2 != 1]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo2< // CHECK-NOELIDE-TREE: [1 != 2]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo2< // CHECK-NOELIDE-TREE: [1 != 2]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo2< // CHECK-NOELIDE-TREE: [(default) 2 != 1]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo2< // CHECK-NOELIDE-TREE: [(default) 2 != 1]> void Play3() { Foo3<1> F1; Foo3<2, 1> F2, F3; F2 = F1; F1 = F2; F2 = F3; F3 = F2; } // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'const Foo3<2, 1>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'const Foo3<1, (no argument)>' for 1st argument // CHECK-ELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'const Foo3<2, 1>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<1, (no argument)>' to 'Foo3<2, 1>' for 1st argument // CHECK-NOELIDE-NOTREE: no viable overloaded '=' // CHECK-NOELIDE-NOTREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'const Foo3<1, (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: candidate function (the implicit move assignment operator) not viable: no known conversion from 'Foo3<2, 1>' to 'Foo3<1, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo3< // CHECK-ELIDE-TREE: [1 != 2], // CHECK-ELIDE-TREE: [(no argument) != 1]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo3< // CHECK-ELIDE-TREE: [1 != 2], // CHECK-ELIDE-TREE: [(no argument) != 1]> // CHECK-ELIDE-TREE: no viable overloaded '=' // CHECK-ELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: [(no qualifiers) != const] Foo3< // CHECK-ELIDE-TREE: [2 != 1], // CHECK-ELIDE-TREE: [1 != (no argument)]> // CHECK-ELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-ELIDE-TREE: Foo3< // CHECK-ELIDE-TREE: [2 != 1], // CHECK-ELIDE-TREE: [1 != (no argument)]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo3< // CHECK-NOELIDE-TREE: [1 != 2], // CHECK-NOELIDE-TREE: [(no argument) != 1]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo3< // CHECK-NOELIDE-TREE: [1 != 2], // CHECK-NOELIDE-TREE: [(no argument) != 1]> // CHECK-NOELIDE-TREE: no viable overloaded '=' // CHECK-NOELIDE-TREE: candidate function (the implicit copy assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: [(no qualifiers) != const] Foo3< // CHECK-NOELIDE-TREE: [2 != 1], // CHECK-NOELIDE-TREE: [1 != (no argument)]> // CHECK-NOELIDE-TREE: candidate function (the implicit move assignment operator) not viable: no known conversion from argument type to parameter type for 1st argument // CHECK-NOELIDE-TREE: Foo3< // CHECK-NOELIDE-TREE: [2 != 1], // CHECK-NOELIDE-TREE: [1 != (no argument)]> } namespace PR14342 { template<typename T, short a> struct X {}; X<int, (signed char)-1> x = X<long, -1>(); X<int, 3UL> y = X<int, 2>(); // CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>' // CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<[...], 2>' to 'X<[...], 3>' } namespace PR14489 { // The important thing here is that the diagnostic diffs a template specialization // with no arguments against itself. (We might need a different test if this // diagnostic changes). template<class ...V> struct VariableList { void ConnectAllToAll(VariableList<>& params = VariableList<>()) { } }; // CHECK-ELIDE-NOTREE: non-const lvalue reference to type 'VariableList<>' cannot bind to a temporary of type 'VariableList<>' } namespace rdar12456626 { struct IntWrapper { typedef int type; }; template<typename T, typename T::type V> struct X { }; struct A { virtual X<IntWrapper, 1> foo(); }; struct B : A { // CHECK-ELIDE-NOTREE: virtual function 'foo' has a different return type virtual X<IntWrapper, 2> foo(); }; } namespace PR15023 { // Don't crash when non-QualTypes are passed to a diff modifier. template <typename... Args> void func(void (*func)(Args...), Args...) { } void bar(int, int &) { } void foo(int x) { func(bar, 1, x) } // CHECK-ELIDE-NOTREE: no matching function for call to 'func' // CHECK-ELIDE-NOTREE: candidate template ignored: deduced conflicting types for parameter 'Args' (<int, int &> vs. <int, int>) } namespace rdar12931988 { namespace A { template<typename T> struct X { }; } namespace B { template<typename T> struct X { }; } void foo(A::X<int> &ax, B::X<int> bx) { // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B::X<int>' to 'const rdar12931988::A::X<int>' ax = bx; } template<template<typename> class> class Y {}; void bar(Y<A::X> ya, Y<B::X> yb) { // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'Y<template rdar12931988::B::X>' to 'Y<template rdar12931988::A::X>' ya = yb; } } namespace ValueDecl { int int1, int2, default_int; template <const int& T = default_int> struct S {}; typedef S<int1> T1; typedef S<int2> T2; typedef S<> TD; void test() { T1 t1; T2 t2; TD td; t1 = t2; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'S<int2>' to 'S<int1>' t2 = t1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<int2>' td = t1; // TODO: Find out why (default) isn't printed on second template. // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<default_int>' t2 = td; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'S<(default) default_int>' to 'S<int2>' } } namespace DependentDefault { template <typename> struct Trait { enum { V = 40 }; typedef int Ty; static int I; }; int other; template <typename T, int = Trait<T>::V > struct A {}; template <typename T, typename = Trait<T>::Ty > struct B {}; template <typename T, int& = Trait<T>::I > struct C {}; void test() { A<int> a1; A<char> a2; A<int, 10> a3; a1 = a2; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'A<char, [...]>' to 'A<int, [...]>' a3 = a1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'A<[...], (default) 40>' to 'A<[...], 10>' a2 = a3; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'A<int, 10>' to 'A<char, 40>' B<int> b1; B<char> b2; B<int, char> b3; b1 = b2; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B<char, [...]>' to 'B<int, [...]>' b3 = b1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B<[...], (default) int>' to 'B<[...], char>' b2 = b3; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B<int, char>' to 'B<char, int>' C<int> c1; C<char> c2; C<int, other> c3; c1 = c2; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'C<char, (default) I>' to 'C<int, I>' c3 = c1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'C<[...], (default) I>' to 'C<[...], other>' c2 = c3; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'C<int, other>' to 'C<char, I>' } } namespace VariadicDefault { int i1, i2, i3; template <int = 5, int...> struct A {}; template <int& = i1, int& ...> struct B {}; template <typename = void, typename...> struct C {}; void test() { A<> a1; A<5, 6, 7> a2; A<1, 2> a3; a2 = a1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'A<[...], (no argument), (no argument)>' to 'A<[...], 6, 7>' a3 = a1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'A<(default) 5, (no argument)>' to 'A<1, 2>' B<> b1; B<i1, i2, i3> b2; B<i2, i3> b3; b2 = b1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B<[...], (no argument), (no argument)>' to 'B<[...], i2, i3>' b3 = b1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'B<(default) i1, (no argument)>' to 'B<i2, i3>' B<i1, i2, i3> b4 = b1; // CHECK-ELIDE-NOTREE: no viable conversion from 'B<[...], (no argument), (no argument)>' to 'B<[...], i2, i3>' B<i2, i3> b5 = b1; // CHECK-ELIDE-NOTREE: no viable conversion from 'B<(default) i1, (no argument)>' to 'B<i2, i3>' C<> c1; C<void, void> c2; C<char, char> c3; c2 = c1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'C<[...], (no argument)>' to 'C<[...], void>' c3 = c1; // CHECK-ELIDE-NOTREE: no viable overloaded '=' // CHECK-ELIDE-NOTREE: no known conversion from 'C<(default) void, (no argument)>' to 'C<char, char>' } } namespace PointerArguments { template <int *p> class T {}; template <int* ...> class U {}; int a, b, c; int z[5]; void test() { T<&a> ta; T<z> tz; T<&b> tb(ta); // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'T<&b>' // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'T<&a>' to 'const T<&b>' for 1st argument T<&c> tc(tz); // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'T<&c>' // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'T<z>' to 'const T<&c>' for 1st argument U<&a, &a> uaa; U<&b> ub(uaa); // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'U<&b>' // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'U<&a, &a>' to 'const U<&b, (no argument)>' for 1st argument U<&b, &b, &b> ubbb(uaa); // CHECK-ELIDE-NOTREE: no matching constructor for initialization of 'U<&b, &b, &b>' // CHECK-ELIDE-NOTREE: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'U<&a, &a, (no argument)>' to 'const U<&b, &b, &b>' for 1st argument } } namespace DependentInt { template<int Num> struct INT; template <class CLASS, class Int_wrapper = INT<CLASS::val> > struct C; struct N { static const int val = 1; }; template <class M_T> struct M {}; void test() { using T1 = M<C<int, INT<0>>>; using T2 = M<C<N>>; T2 p; T1 x = p; // CHECK-ELIDE-NOTREE: no viable conversion from 'M<C<DependentInt::N, INT<1>>>' to 'M<C<int, INT<0>>>' } } namespace PR17510 { class Atom; template <typename T> class allocator; template <typename T, typename A> class vector; typedef vector<const Atom *, allocator<const Atom *> > AtomVector; template <typename T, typename A = allocator<const Atom *> > class vector {}; void foo() { vector<Atom *> v; AtomVector v2(v); // CHECK-ELIDE-NOTREE: no known conversion from 'vector<PR17510::Atom *, [...]>' to 'const vector<const PR17510::Atom *, [...]>' } } namespace PR15677 { template <bool> struct A{}; template <typename T> using B = A<T::value>; template <typename T> using B = A<!T::value>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<!T::value>' vs 'A<T::value>') template <int> struct C{}; template <typename T> using D = C<T::value>; template <typename T> using D = C<T::value + 1>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C<T::value + 1>' vs 'C<T::value>') template <typename T> using E = C<T::value>; template <typename T> using E = C<42>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C<42>' vs 'C<T::value>') template <typename T> using F = C<T::value>; template <typename T> using F = C<21 + 21>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('C<21 + 21 aka 42>' vs 'C<T::value>') } } namespace AddressOf { template <int*> struct S {}; template <class T> struct Wrapper {}; template <class T> Wrapper<T> MakeWrapper(); int global, global2; constexpr int * ptr = nullptr; Wrapper<S<ptr>> W = MakeWrapper<S<&global>>(); // Don't print an extra '&' for 'ptr' // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<ptr>>' // Handle parens correctly Wrapper<S<(&global2)>> W2 = MakeWrapper<S<&global>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>' Wrapper<S<&global2>> W3 = MakeWrapper<S<(&global)>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>' Wrapper<S<(&global2)>> W4 = MakeWrapper<S<(&global)>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<&global2>>' } namespace NullPtr { template <int*, int*> struct S {}; template <class T> struct Wrapper {}; template <class T> Wrapper<T> MakeWrapper(); int global, global2; constexpr int * ptr = nullptr; constexpr int * ptr2 = static_cast<int*>(0); S<&global> s1 = S<&global, ptr>(); S<&global, nullptr> s2 = S<&global, ptr>(); S<&global, nullptr> s3 = S<&global, &global>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'S<[...], &global>' to 'S<[...], nullptr>' S<&global, ptr> s4 = S<&global, &global>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'S<[...], &global>' to 'S<[...], ptr> Wrapper<S<&global, nullptr>> W1 = MakeWrapper<S<&global, ptr>>(); Wrapper<S<&global, static_cast<int*>(0)>> W2 = MakeWrapper<S<&global, ptr>>(); Wrapper<S<&global, nullptr>> W3 = MakeWrapper<S<&global, &global>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], &global>>' to 'Wrapper<S<[...], nullptr>>' Wrapper<S<&global, ptr>> W4 = MakeWrapper<S<&global, &global>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], &global>>' to 'Wrapper<S<[...], ptr>>' Wrapper<S<&global2, ptr>> W5 = MakeWrapper<S<&global, nullptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, nullptr>> W6 = MakeWrapper<S<&global, nullptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, ptr2>> W7 = MakeWrapper<S<&global, nullptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, nullptr>> W8 = MakeWrapper<S<&global, ptr2>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, ptr>> W9 = MakeWrapper<S<&global, ptr2>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, ptr2>> W10 = MakeWrapper<S<&global, ptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, static_cast<int *>(0)>> W11 = MakeWrapper<S<&global, nullptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global2, nullptr>> W12 = MakeWrapper<S<&global, static_cast<int *>(0)>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>' Wrapper<S<&global, &global>> W13 = MakeWrapper<S<&global, ptr>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], nullptr>>' to 'Wrapper<S<[...], &global>>' Wrapper<S<&global, ptr>> W14 = MakeWrapper<S<&global, &global>>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], &global>>' to 'Wrapper<S<[...], ptr>>' } namespace TemplateTemplateDefault { template <class> class A{}; template <class> class B{}; template <class> class C{}; template <template <class> class, template <class> class = A> class T {}; T<A> t1 = T<A, C>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<[...], template C>' to 'T<[...], (default) template A>' T<A, C> t2 = T<A>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<[...], (default) template A>' to 'T<[...], template C>' T<A> t3 = T<B>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<template B>' to 'T<template A>' T<B, C> t4 = T<C, B>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<template C, template B>' to 'T<template B, template C>' T<A, A> t5 = T<B>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<template B, [...]>' to 'T<template A, [...]>' T<B> t6 = T<A, A>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'T<template A, [...]>' to 'T<template B, [...]>' } namespace Bool { template <class> class A{}; A<bool> a1 = A<int>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'A<int>' to 'A<bool>' A<int> a2 = A<bool>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'A<bool>' to 'A<int>' } namespace TypeAlias { template <int, int = 0> class A {}; template <class T> using a = A<T::num, 0>; template <class T> using a = A<T::num>; template <class T> using A1 = A<T::num>; template <class T> using A1 = A<T::num + 0>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<T::num + 0>' vs 'A<T::num>') template <class T> using A2 = A<1 + T::num>; template <class T> using A2 = A<T::num + 1>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<T::num + 1>' vs 'A<1 + T::num>') template <class T> using A3 = A<(T::num)>; template <class T> using A3 = A<T::num>; // CHECK-ELIDE-NOTREE: error: type alias template redefinition with different types ('A<T::num>' vs 'A<(T::num)>') template <class T> using A4 = A<(T::num)>; template <class T> using A4 = A<((T::num))>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<((T::num))>' vs 'A<(T::num)>') template <class T> using A5 = A<T::num, 1>; template <class T> using A5 = A<T::num>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<[...], (default) 0>' vs 'A<[...], 1>') template <class T> using A6 = A<T::num + 5, 1>; template <class T> using A6 = A<T::num + 5>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<[...], (default) 0>' vs 'A<[...], 1>') template <class T> using A7 = A<T::num, 1>; template <class T> using A7 = A<(T::num)>; // CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<(T::num), (default) 0>' vs 'A<T::num, 1>') } namespace TemplateArgumentImplicitConversion { template <int X> struct condition {}; struct is_const { constexpr operator int() const { return 10; } }; using T = condition<(is_const())>; void foo(const T &t) { T &t2 = t; } // CHECK-ELIDE-NOTREE: binding value of type 'const condition<[...]>' to reference to type 'condition<[...]>' drops 'const' qualifier } namespace BoolArgumentBitExtended { template <bool B> struct BoolT {}; template <typename T> void foo(T) {} void test() { BoolT<false> X; foo<BoolT<true>>(X); } // CHECK-ELIDE-NOTREE: no matching function for call to 'foo' // CHECK-ELIDE-NOTREE: candidate function [with T = BoolArgumentBitExtended::BoolT<true>] not viable: no known conversion from 'BoolT<0>' to 'BoolT<1>' for 1st argument } // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-ELIDE-TREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-TREE: {{[0-9]*}} errors generated.
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-decl.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck -check-prefix CHECK-TU -strict-whitespace %s int TestLocation; // CHECK: VarDecl 0x{{[^ ]*}} <{{.*}}:4:1, col:5> col:5 TestLocation struct TestIndent { int x; }; // CHECK: {{^}}RecordDecl{{.*TestIndent[^()]*$}} // CHECK-NEXT: {{^}}`-FieldDecl{{.*x[^()]*$}} struct TestChildren { int x; struct y { int z; }; }; // CHECK: RecordDecl{{.*}}TestChildren // CHECK-NEXT: FieldDecl{{.*}}x // CHECK-NEXT: RecordDecl{{.*}}y // CHECK-NEXT: FieldDecl{{.*}}z // CHECK-TU: TranslationUnitDecl void testLabelDecl() { __label__ TestLabelDecl; TestLabelDecl: goto TestLabelDecl; } // CHECK: LabelDecl{{.*}} TestLabelDecl typedef int TestTypedefDecl; // CHECK: TypedefDecl{{.*}} TestTypedefDecl 'int' __module_private__ typedef int TestTypedefDeclPrivate; // CHECK: TypedefDecl{{.*}} TestTypedefDeclPrivate 'int' __module_private__ enum TestEnumDecl { testEnumDecl }; // CHECK: EnumDecl{{.*}} TestEnumDecl // CHECK-NEXT: EnumConstantDecl{{.*}} testEnumDecl struct TestEnumDeclAnon { enum { testEnumDeclAnon } e; }; // CHECK: RecordDecl{{.*}} TestEnumDeclAnon // CHECK-NEXT: EnumDecl{{.*> .*$}} enum TestEnumDeclForward; // CHECK: EnumDecl{{.*}} TestEnumDeclForward __module_private__ enum TestEnumDeclPrivate; // CHECK: EnumDecl{{.*}} TestEnumDeclPrivate __module_private__ struct TestRecordDecl { int i; }; // CHECK: RecordDecl{{.*}} struct TestRecordDecl // CHECK-NEXT: FieldDecl struct TestRecordDeclEmpty { }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclEmpty struct TestRecordDeclAnon1 { struct { } testRecordDeclAnon1; }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon1 // CHECK-NEXT: RecordDecl{{.*}} struct struct TestRecordDeclAnon2 { struct { }; }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon2 // CHECK-NEXT: RecordDecl{{.*}} struct struct TestRecordDeclForward; // CHECK: RecordDecl{{.*}} struct TestRecordDeclForward __module_private__ struct TestRecordDeclPrivate; // CHECK: RecordDecl{{.*}} struct TestRecordDeclPrivate __module_private__ enum testEnumConstantDecl { TestEnumConstantDecl, TestEnumConstantDeclInit = 1 }; // CHECK: EnumConstantDecl{{.*}} TestEnumConstantDecl 'int' // CHECK: EnumConstantDecl{{.*}} TestEnumConstantDeclInit 'int' // CHECK-NEXT: IntegerLiteral struct testIndirectFieldDecl { struct { int TestIndirectFieldDecl; }; }; // CHECK: IndirectFieldDecl{{.*}} TestIndirectFieldDecl 'int' // CHECK-NEXT: Field{{.*}} '' // CHECK-NEXT: Field{{.*}} 'TestIndirectFieldDecl' int TestFunctionDecl(int x, enum { e } y) { return x; } // CHECK: FunctionDecl{{.*}} TestFunctionDecl 'int (int, enum {{.*}})' // CHECK-NEXT: EnumDecl // CHECK-NEXT: EnumConstantDecl{{.*}} e // CHECK-NEXT: ParmVarDecl{{.*}} x // CHECK-NEXT: ParmVarDecl{{.*}} y // CHECK-NEXT: CompoundStmt int TestFunctionDeclProto(int x); // CHECK: FunctionDecl{{.*}} TestFunctionDeclProto 'int (int)' // CHECK-NEXT: ParmVarDecl{{.*}} x extern int TestFunctionDeclSC(); // CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int ()' extern inline int TestFunctionDeclInline(); // CHECK: FunctionDecl{{.*}} TestFunctionDeclInline 'int ()' inline struct testFieldDecl { int TestFieldDecl; int TestFieldDeclWidth : 1; __module_private__ int TestFieldDeclPrivate; }; // CHECK: FieldDecl{{.*}} TestFieldDecl 'int' // CHECK: FieldDecl{{.*}} TestFieldDeclWidth 'int' // CHECK-NEXT: IntegerLiteral // CHECK: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__ int TestVarDecl; // CHECK: VarDecl{{.*}} TestVarDecl 'int' extern int TestVarDeclSC; // CHECK: VarDecl{{.*}} TestVarDeclSC 'int' extern __thread int TestVarDeclThread; // CHECK: VarDecl{{.*}} TestVarDeclThread 'int' tls{{$}} __module_private__ int TestVarDeclPrivate; // CHECK: VarDecl{{.*}} TestVarDeclPrivate 'int' __module_private__ int TestVarDeclInit = 0; // CHECK: VarDecl{{.*}} TestVarDeclInit 'int' // CHECK-NEXT: IntegerLiteral void testParmVarDecl(int TestParmVarDecl); // CHECK: ParmVarDecl{{.*}} TestParmVarDecl 'int'
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-arm-attr.c
// RUN: %clang_cc1 -triple arm-apple-darwin -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s __attribute__((interrupt)) void Test(void); // CHECK: FunctionDecl{{.*}}Test // CHECK-NEXT: ARMInterruptAttr
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-msp430-attr.c
// RUN: %clang_cc1 -triple msp430-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck --strict-whitespace %s __attribute__((interrupt(12))) void Test(void); // CHECK: FunctionDecl{{.*}}Test // CHECK-NEXT: MSP430InterruptAttr
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-presumed.c
// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED // RUN: not %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING #line 100 #define X(y) y X(int n = error); // PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error' // PRESUMED: diag-presumed.c:100:14: note: expanded from // SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error' // SPELLING: diag-presumed.c:5:14: note: expanded from ; // PRESUMED: diag-presumed.c:108:1: error: extra ';' outside of a functio // SPELLING: diag-presumed.c:13:1: error: extra ';' outside of a functio # 1 "thing1.cc" 1 # 1 "thing1.h" 1 # 1 "systemheader.h" 1 3 ; // No diagnostic here: we're in a system header, even if we're using spelling // locations for the diagnostics.. // PRESUMED-NOT: extra ';' // SPELLING-NOT: extra ';' another error; // PRESUMED: included from {{.*}}diag-presumed.c:112: // PRESUMED: from thing1.cc:1: // PRESUMED: from thing1.h:1: // PRESUMED: systemheader.h:7:1: error: unknown type name 'another' // SPELLING-NOT: included from // SPELLING: diag-presumed.c:26:1: error: unknown type name 'another' # 1 "thing1.h" 2 # 1 "thing1.cc" 2
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/error-limit-multiple-notes.cpp
// RUN: not %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s // error and three notes emitted void foo(int); void foo(double); void foo(int, int); void foo(int, int, int, int); int main() { foo(1, 2, 3); } // error and note suppressed by error-limit struct s1{}; struct s1{}; // CHECK: 11:5: error: no matching function for call to 'foo' // CHECK: 6:6: note: candidate function not viable: requires 2 arguments, but 3 were provided // CHECK: 7:6: note: candidate function not viable: requires 4 arguments, but 3 were provided // CHECK: 5:6: note: candidate function not viable: requires 1 argument, but 3 were provided // CHECK: 4:6: note: candidate function not viable: requires 1 argument, but 3 were provided // CHECK: fatal error: too many errors emitted, stopping now // CHECK-NOT: 16:8: error: redefinition of 's1' // CHECK-NOT: 15:8: note: previous definition is here
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/tabstop.c
// RUN: %clang_cc1 -ftabstop 3 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-3 -strict-whitespace %s // RUN: %clang_cc1 -ftabstop 4 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-4 -strict-whitespace %s // RUN: %clang_cc1 -ftabstop 5 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-5 -strict-whitespace %s // tab void* a = 1; // tab tab void* b = 1; // 3x space tab void* c = 1; // tab at column 10 void* d = 1; //CHECK-3: {{^ void\* a = 1;}} //CHECK-3: {{^ void\* b = 1;}} //CHECK-3: {{^ void\* c = 1;}} //CHECK-3: {{^void\* d = 1;}} //CHECK-4: {{^ void\* a = 1;}} //CHECK-4: {{^ void\* b = 1;}} //CHECK-4: {{^ void\* c = 1;}} //CHECK-4: {{^void\* d = 1;}} //CHECK-5: {{^ void\* a = 1;}} //CHECK-5: {{^ void\* b = 1;}} //CHECK-5: {{^ void\* c = 1;}} //CHECK-5: {{^void\* d = 1;}} // Test code modification hints void f(void) { if (0 & 1 == 1) {} if (1 == 0 & 1) {} } // CHECK-3: {{^ }}if (0 & 1 == 1) // CHECK-3: {{^ }} ( ) // CHECK-3: {{^ }}if (1 == 0 & 1) // CHECK-3: {{^ }} ( ) // CHECK-4: {{^ }}if (0 & 1 == 1) // CHECK-4: {{^ }} ( ) // CHECK-4: {{^ }}if (1 == 0 & 1) // CHECK-4: {{^ }} ( ) // CHECK-5: {{^ }}if (0 & 1 == 1) // CHECK-5: {{^ }} ( ) // CHECK-5: {{^ }}if (1 == 0 & 1) // CHECK-5: {{^ }} ( )
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags-stable.c
// RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s int foo() { // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 } // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 // CHECK-NEXT: +-{{.*}}serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar; // CHECK-LABEL: Number of diagnostics: 2
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/backend-optimization-failure.cpp
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -O3 -emit-llvm -gline-tables-only -S -verify -o /dev/null // REQUIRES: x86-registered-target // Test verifies optimization failures generated by the backend are handled // correctly by clang. LLVM tests verify all of the failure conditions. void test_switch(int *A, int *B, int Length) { #pragma clang loop vectorize(enable) unroll(disable) for (int i = 0; i < Length; i++) { /* expected-warning {{loop not vectorized: failed explicitly specified loop vectorization}} */ switch (A[i]) { case 0: B[i] = 1; break; case 1: B[i] = 2; break; default: B[i] = 3; } } }
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-special-chars.c
// RUN: %clang_cc1 %s -verify // RUN: not %clang_cc1 %s 2>&1 | FileCheck %s // There is a special characters on the following line, which is used as a // marker character for diagnostic printing. Ensure diagnostics involving // this character does not cause problems with the diagnostic printer. #error Hi  Bye //expected-error@-1 {{Hi Bye}} // CHECK: error: Hi Bye // CHECK: #error Hi <U+007F> Bye
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/cc1as-asm.s
// Run cc1as asm output path just to make sure it works // REQUIRES: x86-registered-target // RUN: %clang -cc1as -triple x86_64-apple-macosx10.10.0 -filetype asm %s -o /dev/null
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/driver-verify.c
// RUN: not %clang -verify %s 2>&1 | FileCheck %s // RUN: %clang -cc1 -verify %s // expected-no-diagnostics // Test that -verify is strictly rejected as unknown by the driver. // CHECK: unknown argument: '-verify'
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-format.c
// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s -check-prefix=DEFAULT // RUN: %clang -fsyntax-only -fdiagnostics-format=clang %s 2>&1 | FileCheck %s -check-prefix=DEFAULT // RUN: %clang -fsyntax-only -fdiagnostics-format=clang -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=DEFAULT // // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc %s 2>&1 | FileCheck %s -check-prefix=MSVC // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 %s 2>&1 | FileCheck %s -check-prefix=MSVC // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s -check-prefix=MSVC2010 // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s -check-prefix=MSVC // // RUN: %clang -fsyntax-only -fdiagnostics-format=vi %s 2>&1 | FileCheck %s -check-prefix=VI // // RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fno-show-column %s 2>&1 | FileCheck %s -check-prefix=MSVC_ORIG // // RUN: %clang -fsyntax-only -fno-show-column %s 2>&1 | FileCheck %s -check-prefix=NO_COLUMN // // RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fmsc-version=1300 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010-FALLBACK // RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fms-compatibility-version=13.00 %s 2>&1 | FileCheck %s -check-prefix=MSVC2010-FALLBACK // RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback %s 2>&1 | FileCheck %s -check-prefix=MSVC-FALLBACK #ifdef foo #endif bad // extension! // DEFAULT: {{.*}}:36:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] // MSVC2010: {{.*}}(36,7) : warning: extra tokens at end of #endif directive [-Wextra-tokens] // MSVC: {{.*}}(36,8) : warning: extra tokens at end of #endif directive [-Wextra-tokens] // VI: {{.*}} +36:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] // MSVC_ORIG: {{.*}}(36) : warning: extra tokens at end of #endif directive [-Wextra-tokens] // NO_COLUMN: {{.*}}:36: warning: extra tokens at end of #endif directive [-Wextra-tokens] // MSVC2010-FALLBACK: {{.*}}(36,7) : error(clang): extra tokens at end of #endif directive // MSVC-FALLBACK: {{.*}}(36,8) : error(clang): extra tokens at end of #endif directive int x;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/ast-dump-wchar.cpp
// RUN: %clang_cc1 -std=c++11 -ast-dump %s -triple x86_64-linux-gnu | FileCheck %s char c8[] = u8"test\0\\\"\t\a\b\234"; // CHECK: StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234" char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234"; // CHECK: StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234" char32_t c32[] = U"test\0\\\"\t\a\b\234\u1234\U0010ffff"; // \ // CHECK: StringLiteral {{.*}} lvalue U"test\000\\\"\t\a\b\234\u1234\U0010FFFF" wchar_t wc[] = L"test\0\\\"\t\a\b\234\u1234\xffffffff"; // \ // CHECK: StringLiteral {{.*}} lvalue L"test\000\\\"\t\a\b\234\x1234\xFFFFFFFF"
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-line-wrapping.cpp
// RUN: not %clang_cc1 -fsyntax-only -fmessage-length 60 %s 2>&1 | FileCheck %s // RUN: not %clang_cc1 -fsyntax-only -fmessage-length 0 %s 2>&1 | FileCheck %s struct B { void f(); }; struct D1 : B {}; struct D2 : B {}; struct DD : D1, D2 { void g() { f(); } // Ensure that after line-wrapping takes place, we preserve artificial // newlines introduced to manually format a section of the diagnostic text. // CHECK: {{.*}}: error: // CHECK: struct DD -> struct D1 -> struct B // CHECK: struct DD -> struct D2 -> struct B }; // A line longer than 4096 characters should cause us to suppress snippets no // matter what -fmessage-length is set to. #pragma clang diagnostic push #pragma clang diagnostic warning "-Wconversion" // CHECK: implicit conversion loses floating-point precision // CHECK-NOT: static const float numbers[] static const float numbers[] = {0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.3529411764705883,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.4117647058823529,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.4705882352941176,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.4117647058823529,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.4705882352941176,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.5294117647058824,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.4705882352941176,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.5294117647058824,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.5294117647058824,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.1764705882352941,0.3529411764705883,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.1764705882352941,0.4117647058823529,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2352941176470588,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2352941176470588,0.4117647058823529,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2352941176470588,0.4705882352941176,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2941176470588235,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2941176470588235,0.4705882352941176,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.2941176470588235,0.5294117647058824,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.3529411764705883,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.1764705882352941,0.3529411764705883,0.5294117647058824,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2352941176470588,0.1176470588235294,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2352941176470588,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2352941176470588,0.4117647058823529,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2941176470588235,0.1764705882352941,0.4117647058823529,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2941176470588235,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.2941176470588235,0.4705882352941176,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.3529411764705883,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.3529411764705883,0.5294117647058824,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2352941176470588,0.4117647058823529,0.2941176470588235,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.2941176470588235,0.1176470588235294,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.2941176470588235,0.1764705882352941,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.3529411764705883,0.1764705882352941,0.3529411764705883,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.3529411764705883,0.2352941176470588,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.4117647058823529,0.2352941176470588,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.2941176470588235,0.4705882352941176,0.2941176470588235,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.3529411764705883,0.1176470588235294,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.3529411764705883,0.1764705882352941,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.4117647058823529,0.1764705882352941,0.2941176470588235,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.4117647058823529,0.2352941176470588,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.4705882352941176,0.2352941176470588,0.2352941176470588,0.1176470588235294,0.1176470588235294,0.3529411764705883,0.5294117647058824,0.2941176470588235,0.1764705882352941,0.1176470588235294,0.1176470588235294,0.4117647058823529}; #pragma clang diagnostic pop
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/serialized-diags.c
void foo() { int voodoo; voodoo = voodoo + 1; } void bar() { int dragon; dragon = dragon + 1 } // Test handling of FixIts that only remove text. int baz(); void qux(int x) { if ((x == baz())) return; } // Test handling of macros. void taz(int x, int y); #define false 0 void testMacro() { taz(0, 0, false); } // Test handling of issues from #includes. #include "serialized-diags.h" // Test handling of warnings that have empty fixits. void rdar11040133() { unsigned x; } // RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.diag > %t 2>&1 // RUN: FileCheck --input-file=%t %s // This test case tests that we can handle multiple diagnostics which contain // FIXITs at different levels (one at the note, another at the main diagnostic). // CHECK: {{.*[/\\]}}serialized-diags.c:3:12: warning: variable 'voodoo' is uninitialized when used here [-Wuninitialized] // CHECK: Range: {{.*[/\\]}}serialized-diags.c:3:12 {{.*[/\\]}}serialized-diags.c:3:18 // CHECK: +-{{.*[/\\]}}serialized-diags.c:2:13: note: initialize the variable 'voodoo' to silence this warning [] // CHECK: +-FIXIT: ({{.*[/\\]}}serialized-diags.c:2:13 - {{.*[/\\]}}serialized-diags.c:2:13): " = 0" // CHECK: {{.*[/\\]}}serialized-diags.c:8:22: error: expected ';' after expression [] // CHECK: FIXIT: ({{.*[/\\]}}serialized-diags.c:8:22 - {{.*[/\\]}}serialized-diags.c:8:22): ";" // CHECK: {{.*[/\\]}}serialized-diags.c:14:10: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] // CHECK: Range: {{.*[/\\]}}serialized-diags.c:14:8 {{.*[/\\]}}serialized-diags.c:14:18 // CHECK: +-{{.*[/\\]}}serialized-diags.c:14:10: note: remove extraneous parentheses around the comparison to silence this warning [] // CHECK: +-FIXIT: ({{.*[/\\]}}serialized-diags.c:14:7 - {{.*[/\\]}}serialized-diags.c:14:8): "" // CHECK: +-FIXIT: ({{.*[/\\]}}serialized-diags.c:14:18 - {{.*[/\\]}}serialized-diags.c:14:19): "" // CHECK: +-{{.*[/\\]}}serialized-diags.c:14:10: note: use '=' to turn this equality comparison into an assignment [] // CHECK: +-FIXIT: ({{.*[/\\]}}serialized-diags.c:14:10 - {{.*[/\\]}}serialized-diags.c:14:12): "=" // CHECK: {{.*[/\\]}}serialized-diags.c:22:13: error: too many arguments to function call, expected 2, have 3 [] // CHECK: Range: {{.*[/\\]}}serialized-diags.c:22:3 {{.*[/\\]}}serialized-diags.c:22:6 // CHECK: Range: {{.*[/\\]}}serialized-diags.c:22:13 {{.*[/\\]}}serialized-diags.c:22:18 // CHECK: +-{{.*[/\\]}}serialized-diags.c:20:15: note: expanded from macro 'false' [] // CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:22:3 {{.*[/\\]}}serialized-diags.c:22:6 // CHECK: +-Range: {{.*[/\\]}}serialized-diags.c:20:15 {{.*[/\\]}}serialized-diags.c:20:16 // CHECK: +-{{.*[/\\]}}serialized-diags.c:19:1: note: 'taz' declared here [] // CHECK: {{.*[/\\]}}serialized-diags.h:5:7: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion] // CHECK: Range: {{.*[/\\]}}serialized-diags.h:5:16 {{.*[/\\]}}serialized-diags.h:5:17 // CHECK: +-{{.*[/\\]}}serialized-diags.c:26:10: note: in file included from {{.*[/\\]}}serialized-diags.c:26: [] // CHECK: Number FIXITs = 0 // CHECK: {{.*[/\\]}}serialized-diags.c:30:12: warning: unused variable 'x' // CHECK: Number FIXITs = 0 // CHECK: Number of diagnostics: 6
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-mapping.c
// This should warn by default. // RUN: %clang_cc1 %s 2>&1 | grep "warning:" // This should not emit anything. // RUN: %clang_cc1 %s -Wno-extra-tokens 2>&1 | not grep diagnostic // -Werror can map all warnings to error. // RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error:" // -Werror can map this one warning to error. // RUN: not %clang_cc1 %s -Werror=extra-tokens 2>&1 | grep "error:" // Mapping unrelated diags to errors doesn't affect this one. // RUN: %clang_cc1 %s -Werror=trigraphs 2>&1 | grep "warning:" // This should stay a warning with -pedantic. // RUN: %clang_cc1 %s -pedantic 2>&1 | grep "warning:" // This should emit an error with -pedantic-errors. // RUN: not %clang_cc1 %s -pedantic-errors 2>&1 | grep "error:" // This should emit a warning, because -Wfoo overrides -pedantic*. // RUN: %clang_cc1 %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:" // This should emit nothing, because -Wno-extra-tokens overrides -pedantic* // RUN: %clang_cc1 %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic #ifdef foo #endif bad // extension! int x;
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/permissions.cpp
// REQUIRES: shell // MSYS doesn't emulate umask. // FIXME: Could we introduce another feature for it? // REQUIRES: shell-preserves-root // RUN: umask 000 // RUN: %clang_cc1 -emit-llvm-bc %s -o %t // RUN: ls -l %t | FileCheck --check-prefix=CHECK000 %s // CHECK000: rw-rw-rw- // RUN: umask 002 // RUN: %clang_cc1 -emit-llvm-bc %s -o %t // RUN: ls -l %t | FileCheck --check-prefix=CHECK002 %s // CHECK002: rw-rw-r--
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/diag-mapping2.c
// This should warn by default. // RUN: %clang_cc1 %s 2>&1 | grep "warning: foo" // This should not emit anything. // RUN: %clang_cc1 %s -w 2>&1 | not grep diagnostic // RUN: %clang_cc1 %s -Wno-#warnings 2>&1 | not grep diagnostic // -Werror can map all warnings to error. // RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error: foo" // -Werror can map this one warning to error. // RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error: foo" // -Wno-error= overrides -Werror. rdar://3158301 // RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning: foo" // -Wno-error overrides -Werror. PR4715 // RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo" #warning foo
0
repos/DirectXShaderCompiler/tools/clang/test
repos/DirectXShaderCompiler/tools/clang/test/Misc/message-length.c
// RUN: not %clang_cc1 -fmessage-length 72 %s 2>&1 | FileCheck -strict-whitespace %s // RUN: not %clang_cc1 -fmessage-length 1 %s // RUN: not %clang_cc1 -fmessage-length 8 %s 2>&1 | FileCheck -check-prefix=CHECK-DOT %s // Hack so we can check things better, force the file name and line. # 1 "FILE" 1 /* It's tough to verify the results of this test mechanically, since the length of the filename (and, therefore, how the word-wrapping behaves) changes depending on where the test-suite resides in the file system. */ void f(int, float, char, float); void g() { int (*fp1)(int, float, short, float) = f; int (*fp2)(int, float, short, float) = f; } void a_func_to_call(int, int, int); void a_very_long_line(int *ip, float *FloatPointer) { for (int ALongIndexName = 0; ALongIndexName < 100; ALongIndexName++) if (ip[ALongIndexName] == 17) a_func_to_call(ip == FloatPointer, ip[ALongIndexName], FloatPointer[ALongIndexName]); int array0[] = { [3] 3, 5, 7, 4, 2, 7, 6, 3, 4, 5, 6, 7, 8, 9, 12, 345, 14, 345, 789, 234, 678, 345, 123, 765, 234 }; } #pragma STDC CX_LIMITED_RANGE // some long comment text and a brace, eh {} // CHECK: FILE:23:78 // CHECK: {{^ ...// some long comment text and a brace, eh {}}} struct A { int x; }; void h(struct A *a) { // CHECK-DOT: member // CHECK-DOT: reference // CHECK-DOT: type (void)a . x; }
0
repos/DirectXShaderCompiler/tools/clang/test/Misc
repos/DirectXShaderCompiler/tools/clang/test/Misc/Inputs/include.h
#define EQUALS(a,b) a == b int foo(int x) { return x; }