
As reported here: https://bugs.llvm.org/show_bug.cgi?id=37033 Any usage of a builtin function that uses a va_list by reference will cause an assertion when redeclaring it. After discussion in the review, it was concluded that the correct way of accomplishing this fix is to make attempts to redeclare certain builtins an error. Unfortunately, doing this limitation for all builtins is likely a breaking change, so this commit simply limits it to types with custom type checking and those that take a reference. Two tests needed to be updated to make this work. Differential Revision: https://reviews.llvm.org/D45383 llvm-svn: 330160
19 lines
718 B
C++
19 lines
718 B
C++
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify -x c
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-compatibility
|
|
|
|
// Redeclaring library builtins is OK.
|
|
void exit(int);
|
|
|
|
// expected-error@+2 {{cannot redeclare builtin function '__builtin_va_copy'}}
|
|
// expected-note@+1 {{'__builtin_va_copy' is a builtin with type}}
|
|
void __builtin_va_copy(double d);
|
|
|
|
// expected-error@+2 {{cannot redeclare builtin function '__builtin_va_end'}}
|
|
// expected-note@+1 {{'__builtin_va_end' is a builtin with type}}
|
|
void __builtin_va_end(__builtin_va_list);
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify -x c
|
|
|
|
void __va_start(__builtin_va_list*, ...);
|