llvm-project/clang/test/Modules/internal-constants.cpp
Richard Smith 5cd86f8cec [modules] Rationalize the behavior of Decl::declarationReplaces, and in
particular don't assume that two declarations of the same kind in the same
context are declaring the same entity. That's not true when the same name is
declared multiple times as internal-linkage symbols within a module.
(getCanonicalDecl is cheap now, so we can just use it here.)

llvm-svn: 251898
2015-11-03 03:13:11 +00:00

13 lines
374 B
C++

// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-local-submodule-visibility -I%S/Inputs/internal-constants %s -verify
// expected-no-diagnostics
#include "c.h"
int q = h();
int r = N::k;
#include "b.h"
int s = N::k; // FIXME: This should be ambiguous if we really want internal linkage declarations to not collide.