__restrict on methods? · Issue #11039 · llvm/llvm-project (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@echristo

Description

@echristo

Bugzilla Link 10667
Version trunk
OS All
CC @efriedma-quic,@dobbelaj-snps,@zygoloid

Extended Description

llvm/test/FrontendC++/2007-08-01-RestrictMethod.cpp has this code:

class foo { int member[4];

void bar(int * a);

};

void foo::bar(int * a) __restrict { member[3] = *a; }

that clang rejects:

/Volumes/Data/sources/llvm/tools/clang/test/CodeGenCXX/2007-08-01-RestrictMethod.cpp:11:11: error: out-of-line definition of 'bar' does not match any declaration in 'foo'
void foo::bar(int * a) __restrict {
     ~~~~~^
/Volumes/Data/sources/llvm/tools/clang/test/CodeGenCXX/2007-08-01-RestrictMethod.cpp:7:8: note: member declaration nearly matches
  void bar(int * a);
       ^
1 error generated.

and llvm-gcc accepts.

Not quite sure what we should do for this and whether or not we should accept the code.