
MSVC's pragma alloc_text accepts a function that was redeclared in a non extern-C context if the previous declaration was in an extern-C context. i.e. ``` extern "C" { static void f(); } static void f(); ``` MSVC's pragma alloc_text also rejects non-functions. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D128649
13 lines
328 B
C
13 lines
328 B
C
// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s
|
|
|
|
void foo();
|
|
#pragma alloc_text("hello", foo) // no-error
|
|
void foo() {}
|
|
|
|
static void foo1();
|
|
#pragma alloc_text("hello", foo1) // no-error
|
|
void foo1() {}
|
|
|
|
int foo2;
|
|
#pragma alloc_text(c, foo2) // expected-error {{'#pragma alloc_text' is applicable only to functions}}
|